def scan():
 ret = []
 devices = bluetooth.discover_devices(lookup_names=True)
 for device in devices:
  ret.append({device[0]: device[1]})
 return ret

def scan ( ) : ret = [ ] devices = bluetooth . discover_devices ( lookup_names = True ) for device in devices : ret . append ( { device [ 0 ] : device [ 1 ] } ) return ret
scan for available ports .