title: cant find any usb with pyserial
body: <p>My goal is to look for the files on usb stick, but first I need to find out how to detect usb stick which is connected to computer. I have this code:</p>
  
  <p>main.py</p>
  
  <pre><code>class tst(QtGui.QWidget):
      def __init__(self):
          super(tst, self).__init__()
  
          ports = scanSerial()
          print ports
  </code></pre>
  
  <p>port.py file</p>
  
  <pre><code>def scanSerial():
      available = []
      for i in range(256):
          try:
              s = serial.Serial("/dev/ttyUSB" + str(i))
              available.append(s.portstr)
              s.close()  
          except serial.SerialException as e:
              print e
  
      return available
  </code></pre>
  
  <p>And the output is:</p>
  
  <pre><code>[Errno 2] could not open port /dev/ttyUSB0: [Errno 2] No such file or directory: '/dev/ttyUSB0'
  [Errno 2] could not open port /dev/ttyUSB1: [Errno 2] No such file or directory: '/dev/ttyUSB1'
  [Errno 2] could not open port /dev/ttyUSB2: [Errno 2] No such file or directory: '/dev/ttyUSB2'
  [Errno 2] could not open port /dev/ttyUSB3: [Errno 2] No such file or directory: '/dev/ttyUSB3'
  [Errno 2] could not open port /dev/ttyUSB4: [Errno 2] No such file or directory: '/dev/ttyUSB4'
  [Errno 2] could not open port /dev/ttyUSB5: [Errno 2] No such file or directory: '/dev/ttyUSB5'
  [Errno 2] could not open port /dev/ttyUSB6: [Errno 2] No such file or directory: '/dev/ttyUSB6'
  [Errno 2] could not open port /dev/ttyUSB7: [Errno 2] No such file or directory: '/dev/ttyUSB7'
  [Errno 2] could not open port /dev/ttyUSB8: [Errno 2] No such file or directory: '/dev/ttyUSB8'
  [Errno 2] could not open port /dev/ttyUSB9: [Errno 2] No such file or directory: '/dev/ttyUSB9'
  </code></pre>
  
  <p>If I use ttyS* instead of ttyUSB there is something:</p>
  
  <pre><code>Could not configure port: (5, 'Input/output error')
  Could not configure port: (5, 'Input/output error')
  Could not configure port: (5, 'Input/output error')
  Could not configure port: (5, 'Input/output error')
  </code></pre>
  
  <p>So question is how to get to the attacked USB?</p>
  
  <p>Regards, Marius</p>
  
  <p>EDIT: will try pyUSB. Thank to you all guys!</p>