All pastes #874361 Raw Edit

Mine

public text v1 · immutable
#874361 ·published 2008-01-27 06:42 UTC
rendered paste body
john@Schala:~$ python test.py 
Traceback (most recent call last):
  File "test.py", line 7, in <module>
    print_name(devices[0]['host'])
IndexError: list index out of range
john@Schala:~$ cat test.py 
import bluetooth
devices = bluetooth.find_service(name = 'Audio Source')
def print_name(mac):
	for i in range(10):
		name = bluetooth.lookup_name(mac)
		print u'i = ' + str(i) + ' res = ' + str(name)
print_name(devices[0]['host'])