18 lines
730 B
Python
Executable File
18 lines
730 B
Python
Executable File
#! /usr/bin/env python3
|
|
|
|
import serial.tools.list_ports
|
|
from serial.tools.list_ports_common import ListPortInfo
|
|
|
|
if __name__ == "__main__":
|
|
ports = serial.tools.list_ports.comports()
|
|
for port in ports:
|
|
if port.interface and port.interface.startswith("CircuitPython CDC2"): # CDC2 is the data-port
|
|
print(f"Port: {port.device}")
|
|
print(f" Description: {port.description}")
|
|
print(f" Manufacturer: {port.manufacturer}")
|
|
print(f" VID: {port.vid}")
|
|
print(f" PID: {port.pid}")
|
|
print(f" Serial Number: {port.serial_number}")
|
|
print(f" Location: {port.location}")
|
|
print(f" Interface: {port.interface}")
|
|
print() |