Advertisement
skip420

Bluetooth_scan

Aug 29th, 2021 (edited)
1,201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.42 KB | None | 0 0
  1. # sudo aptinstall bluetooth
  2. # sudo apt-get update
  3. # sudo apt-get install bluetooth
  4. # sudo apt-get install bluez
  5. # sudo apt-get install python-bluez
  6. # python BlueTooth.py
  7.  
  8.  
  9.  
  10. from bluetooth import *
  11.  
  12. print ("performing inquiry...")
  13.  
  14. nearby_devices = discover_devices(lookup_names = True)
  15.  
  16. print ("found %d devices") % len(nearby_devices)
  17.  
  18. for name, addr in nearby_devices:
  19.      print (" %s - %s") % (addr, name)
  20.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement