浏览代码

add helper file to list com ports with a LOCATION entry

Noah Vogt 1 月之前
父节点
当前提交
44a228980f
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5 0
      ls_com_ports.py

+ 5 - 0
ls_com_ports.py

@@ -0,0 +1,5 @@
+from serial.tools import list_ports
+
+for port in list_ports.comports():
+    if "LOCATION=" in port.hwid:
+        print(port.hwid)