title: Python Bluetooth how to send a file to a phone
body: <p>in my current project it is a requirement to send a file from a windows computer to an android device over bluetooth without anything on the phone other than it's standard state and of course a paired bluetooth connection. i've looked over pybluez and it seemed simple enough to send files between a client and server architecture (and in fact got it sending between my laptop and desktop rather quickly) but I cannot for the life of me find any way to get python to send a file from the computer to android once the connection is established; my attempts have been grabbing the bluetooth mac address like thing from the device like so</p>
  
  <pre><code>nearby_devices = bluetooth.discover_devices(
      duration=8, lookup_names=True, flush_cache=True, lookup_class=False)
  </code></pre>
  
  <p>and then later trying to send the files like so</p>
  
  <pre><code>port = 1
  for addr, name in nearby_devices:
      bd_addr = addr
  sock=bluetooth.BluetoothSocket( bluetooth.RFCOMM )
  sock.connect((bd_addr, port))
  
  sock.send("download-app")
  sock.close()
  </code></pre>
  
  <p>Of course with the example script given by the pybluez documentation I can seamlessly send files between a client and a server but I am still stuck without a way to send a file to the selected android device (even if I specify it's address and know it's within range) </p>