23

I searched for lib for bluetooth programming in python and I found PyBluez but it is not compatible with Python 3. So is there any other free library for bluetooth programming compatible with Python 3?

mrts
  • 16,697
  • 8
  • 89
  • 72
Hadi
  • 5,328
  • 11
  • 46
  • 67

3 Answers3

39

PyBluez now supports Python 3.

Like the other answers state, there is inbuilt support for Bluetooth in Python sockets (Python 3.3 and above). However, there is little to no documentation on how to actually use the sockets with Bluetooth. I wrote a brief tutorial so that I could refer back to it once I forget. You might find it useful.

Kevin
  • 4,070
  • 4
  • 45
  • 67
  • 4
    Alas, the "AF_BLUETOOTH" option does not appear to be available on Windows. Most disappointing. My team has used PyBluez extensively and it works well _if_ you have a compatible setup. The lack of maintenance is disappointing, but it's better than rolling our own. – John Crawford Jan 12 '15 at 18:59
  • 2
    PyBluez is no longer under active development. –  Dec 31 '19 at 11:36
9

On python 3.3 there is native support!! You can use bluetooth like a socket object

http://docs.python.org/3.3/library/socket.html

piertoni
  • 1,933
  • 1
  • 18
  • 30
  • 1
    @JohnCrawford claims that it doesn't work on Windows, therefore this (probably) is not cross-platform. – Xbox One Sep 10 '20 at 18:24
  • 1
    In Python 3.9 there is now support for Bluetooth on Windows with the native socket library. https://bugs.python.org/issue36590 – ukBaz Dec 29 '20 at 07:59
1

pybluez is now ported to python 3: http://code.google.com/p/pybluez/downloads/list

br,

karulis
  • 19
  • 1