is that any way to set the range(distance) of bluetooth in raspberry pi using python???
I think your best shot is to get the list of all available devices addresses and then check the RSSI (received signal strength indicator).
Then you can filter all the addresses that are in the desired range.