diff options
author | vg <vgm+dev@devys.org> | 2020-07-07 16:24:01 +0200 |
---|---|---|
committer | vg <vgm+dev@devys.org> | 2020-07-07 16:24:01 +0200 |
commit | 66dcf910bd4744d8ced56cb9586aa937a1a2d4c5 (patch) | |
tree | df4dca1ae4af1e5df0be0d1f4f2cd0d54751f8e8 /identty.py | |
download | hic-master.tar.gz hic-master.tar.bz2 hic-master.zip |
Diffstat (limited to 'identty.py')
-rwxr-xr-x | identty.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/identty.py b/identty.py new file mode 100755 index 0000000..a2f3f32 --- /dev/null +++ b/identty.py @@ -0,0 +1,19 @@ +#!/usr/bin/env python + +import os + +def identify(): + ports=[] + o=os.popen('cat /proc/tty/driver/usbserial') + p=o.read() + q=p.split('\n') + for i in range(len(q)): + r=q[i].partition('"')[2].partition('"')[0] + if len(r): + ports.append(['/dev/ttyUSB'+str(i-1),r]) + return ports + +if __name__=='__main__': + p=identify() + for i in p: + print i[0]+' : '+i[1] |