-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserialEnu.py
29 lines (23 loc) · 925 Bytes
/
serialEnu.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
## SerialEnu - Serial Enumerator for OS wide compatibility
## returns: nothing
import serial.tools.list_ports
def SerialMyEnumerator():
print('\n\nLooking for serial ports on your system...\n\n')
pa = list(serial.tools.list_ports.comports())
if len(pa) != 0:
print('Found %d elements\n' % len(pa))
for port in pa:
print('\n========================================')
print('Name: ', port.name)
print('Desc.: ', port.description)
print('Device: ', port.device)
print('HwId: ', port.hwid)
print('Interface: ', port.interface)
print('Location: ', port.location)
print('Manufacturer: ', port.manufacturer)
print('PID: ', port.pid)
print('Product: ', port.product)
print('SerialNumber: ', port.serial_number)
print('Vid: ', port.vid)
print('========================================\n')
return