2010-12-05 60 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支持的信息。