Hi,
I am writing some code for android using python. I want to control the visibility of bluetooth ( i.e on or off of the bluetooth visibility) using some python script. Can you please help me ?

All the Info you need, is accessible through the API documentation: menu > help > API help > bluetooth facade.

from android import Android

droid = Android()

check = droid.checkBluetoothState().result
if check != 1:
    droid.toggleBluetoothState(1,0)
    print "Bluetooth turned ON!"
    droid.bluetoothMakeDiscoverable(300)
    print "Bluetooth is Discoverable for 300sec now"

else:
    droid.toggleBluetoothState(0,0)
    print "Bluetooth turned OFF!"