8 except Exception
as error:
14 .-------------------------------.
15 ( You need Super Cow Powers here. )
16 '-------------------------------'
27 """ rewriting method """
28 chars = string.ascii_uppercase + string.digits
29 return ''.join(random.choice(chars)
for _
in range(20))
34 PORTS_AVAILABLE = glob(
'/dev/ttyUSB*') + glob(
'/dev/ttyACM*')
36 for port, desc, hwid
in sorted(
comports()):
38 PORTS_AVAILABLE.append(port)
39 except Exception
as error:
41 if len(PORTS_AVAILABLE) == 0:
42 PORTS_AVAILABLE =
None
44 return PORTS_AVAILABLE