K2LL33D SHELL

 Apache/2.4.7 (Ubuntu)
 Linux sman1baleendah 3.13.0-24-generic #46-Ubuntu SMP Thu Apr 10 19:11:08 UTC 2014 x86_64
 uid=33(www-data) gid=33(www-data) groups=33(www-data)
 safemode : OFF
 MySQL: ON | Perl: ON | cURL: OFF | WGet: ON
  >  / usr / share / doc / python-serial / examples /
server ip : 172.67.156.115

your ip : 172.71.255.78

H O M E


Filename/usr/share/doc/python-serial/examples/scanlinux.py
Size481
Permissionrw-r--r--
Ownerroot : root
Create time27-Apr-2025 09:56
Last modified04-Mar-2011 09:27
Last accessed06-Jul-2025 23:32
Actionsedit | rename | delete | download (gzip)
Viewtext | code | image
#! /usr/bin/env python
"""\
Scan for serial ports. Linux specific variant that also includes USB/Serial
adapters.

Part of pySerial (http://pyserial.sf.net)
(C) 2009 <[email protected]>
"""

import serial
import glob

def scan():
"""scan for available ports. return a list of device names."""
return glob.glob('/dev/ttyS*') + glob.glob('/dev/ttyUSB*') + glob.glob('/dev/ttyACM*')

if __name__=='__main__':
print "Found ports:"
for name in scan():
print name