from bluetooth import * from select import * sock=BluetoothSocket( RFCOMM ) sock.setblocking(False) try: sock.connect(("01:23:45:67:89:AB", 3)) except: pass while True: print "waiting for connection" readable, writable, excepts = select( [], [sock], [], 1 ) if sock in writable: sock.send("hello!!") sock.close() break