error bluetooth
Dave Angel
d at davea.name
Fri Oct 5 06:33:18 EDT 2012
On 10/05/2012 04:51 AM, Luca Sanna wrote:
> the code is output the error of the ubuntu
>
> from bluetooth import *
>
> target_name = "My Phone"
> target_address = None
>
> nearby_devices = discover_devices()
>
> for address in nearby_devices:
> if target_name == lookup_name( address ):
> target_address = address
> break
>
> if target_address is not None:
> print "found target bluetooth device with address", target_address
> else:
> print "could not find target bluetooth device nearby"
>
> the error
>
> luca at luca-XPS-M1330:~/py-temperature/py-temperature$ python bluetooth.py
> Traceback (most recent call last):
> File "bluetooth.py", line 14, in <module>
> from bluetooth import *
> File "/home/luca/py-temperature/py-temperature/bluetooth.py", line 19, in <module>
> nearby_devices = discover_devices()
> NameError: name 'discover_devices' is not defined
> luca at luca-XPS-M1330:~/py-temperature/py-temperature$
>
> it's a bug of the module? thanks
Perhaps you named your script bluetooth.py, and thus masked the module
bluetooth.py. Pick a different name for your own sources.
--
DaveA
More information about the Python-list
mailing list