16 lines
414 B
Python
16 lines
414 B
Python
|
import serial.tools.list_ports
|
||
|
|
||
|
ports = serial.tools.list_ports.comports()
|
||
|
|
||
|
for port, desc, hwid in sorted(ports):
|
||
|
print("{}: {} [{}]".format(port, desc, hwid))
|
||
|
|
||
|
available_ports = {}
|
||
|
for port in ports:
|
||
|
print(port.serial_number)
|
||
|
available_ports['/dev/' + port.name] = port.vid
|
||
|
devices = [port for port in available_ports.keys()]
|
||
|
print(devices)
|
||
|
print(ports[1].manufacturer)
|
||
|
#print(ports[0].name)
|