add get sub port
This commit is contained in:
parent
88da9c0ae1
commit
01234592fd
3 changed files with 17 additions and 1 deletions
15
bin/getUSBport.py
Normal file
15
bin/getUSBport.py
Normal file
|
@ -0,0 +1,15 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
import sys
|
||||
import labhw
|
||||
|
||||
|
||||
name = 'Arduino__www_arduino_cc__75833353035351903182'
|
||||
name = sys.argv[1]
|
||||
|
||||
devices = labhw.list_USB_devices()
|
||||
|
||||
try:
|
||||
print(devices[name])
|
||||
except KeyError as e:
|
||||
raise RuntimeError(f"unknown device {name}")
|
Loading…
Add table
Add a link
Reference in a new issue