2010-12-05 55 views
1

我试图运行此脚本:蟒蛇蓝牙发现与pybluez

import PyOBEX 
import bluetooth 

print "performing inquiry..." 

nearby_devices = bluetooth.discover_devices(lookup_names = True) 

print "found %d devices" % len(nearby_devices) 

for name, addr in nearby_devices: 
    print " %s - %s" % (addr, name) 

但是我收到一个未实现的错误终端。这是我得到的输出:

Last login: Sat Dec 4 20:59:06 on ttys001 
You have mail. 
cd '/Users/riceje7/School/NMD 430/' && '/usr/bin/pythonw' '/Users/riceje7/School/NMD 430/BluetoohLocator.py' && echo Exit status: $? && exit 1 
Joseph-Rices-MacBook-Pro:~ riceje7$ cd '/Users/riceje7/School/NMD 430/' && '/usr/bin/pythonw' '/Users/riceje7/School/NMD 430/BluetoohLocator.py' && echo Exit status: $? && exit 1 
Traceback (most recent call last): 
File "/Users/riceje7/School/NMD 430/BluetoohLocator.py", line 2, in <module> 
import bluetooth 
File "/Library/Python/2.6/site-packages/bluetooth/__init__.py", line 36, in <module> 
from osx import * 
File "/Library/Python/2.6/site-packages/bluetooth/osx.py", line 3, in <module> 
raise NotImplementedError 
NotImplementedError 

任何人都可以帮我弄清楚发生了什么事,为什么脚本不能正常运行?

回答

3

source code for init.py

elif sys.platform == "darwin": 
    from osx import * 

而且source code for osx.py

from btcommon import * 

raise NotImplementedError 

这与网页,只提到Linux和Windows的实现是一致的。您可能必须在开发者的路线图上向开发人员查询有关OSX支持的信息。