如何在Python3.6中激活socket.AF_BLUETOOTH?

Wol*_*fiG 5 python sockets bluetooth bluetooth-lowenergy

我在 Windows 中使用 Python3.6 标准安装,我尝试这样做

>>>import socket
>>>socket.AF_BLUETOOTH
Run Code Online (Sandbox Code Playgroud)

系统响应为

AttributeError: module 'socket' has no attribute 'AF_BLUETOOTH'
Run Code Online (Sandbox Code Playgroud)

我和一位同事已经花了一些时间阅读论坛。我扫描了PythonPath\Lib\中的socket.py,但也没有提到AF_BLUETOOTH。有一个stackoverflow线程在Anaconda Python中缺少socket.AF_BLUETOOTH?其中讨论了重新编译 Python,并对某些 .header 文件进行一些更改。

任何人都可以提供更多关于如何获取正在运行的Python/套接字/蓝牙的详细信息吗?

小智 3

看来它在 Windows 端口上不可用:

Linux 上 3.6.7 没问题

W10 以 3.6.7 KO

最好在文档中有一个警告,我已经找到了......