用pybluez进行蓝牙发现的python程序 您所在的位置:网站首页 python中的pybluez搜索不到设备 用pybluez进行蓝牙发现的python程序

用pybluez进行蓝牙发现的python程序

2023-08-08 00:52| 来源: 网络整理| 查看: 265

百度翻译此文   有道翻译此文 问题描述

i am trying to run this script:

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)

however i am getting a not implemented error in terminal. this is the out put that i get:

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 import bluetooth File "/Library/Python/2.6/site-packages/bluetooth/__init__.py", line 36, in from osx import * File "/Library/Python/2.6/site-packages/bluetooth/osx.py", line 3, in raise NotImplementedError NotImplementedError

can anyone help me figure out what is going on and why the script won't run properly?

推荐答案

The source code for init.py has

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

And the source code for osx.py is

from btcommon import * raise NotImplementedError

This is consistent with the web page that only mentions Linux and Windows implementations. You'll probably have to check with the developer about OSX support on their roadmap.



【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有