Skip to content

Instantly share code, notes, and snippets.

@wwj718
Created September 29, 2018 06:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wwj718/070f664e78e70a46540fea3670c4478b to your computer and use it in GitHub Desktop.
Save wwj718/070f664e78e70a46540fea3670c4478b to your computer and use it in GitHub Desktop.
# https://gist.github.com/midoriiro/320c6990ab8e66343a7b
from PyQt5 import QtBluetooth
from PyQt5.QtBluetooth import QBluetoothLocalDevice
local_device = QBluetoothLocalDevice()
# 查看本机蓝牙 mac
all = local_device.allDevices()
first = all[0]
address = first.address().toString() # 88:E9:FE:5B:99:04
# first.name() # wuwenjie的MacBook Pro
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment