title: Access USB serial ports using Python and pyserial
body: <p>How do I access the USB port using pyserial? I have seen an <a href="https://electronics.stackexchange.com/questions/13665/what-is-the-simplest-and-cheapest-way-to-interface-with-usb/13678#13678">example</a> with:</p>
  
  <pre><code>import serial
  
  ser = serial.Serial('/dev/ttyUSB0')
  </code></pre>
  
  <p>I used to access the serial port from MATLAB on Windows and using the appropriate syntax, <code>/dev/ttyUSB0</code> would be replaced by <code>COM1</code> or any other COM port.</p>
  
  <p>I'm on a Mac and I tried using the <a href="http://pyserial.sourceforge.net/examples.html#finding-serial-ports" rel="noreferrer">serial port scanners</a> on the <code>pyserial</code> documentation to no avail. I think I should write it like this:</p>
  
  <pre><code>import serial
  
  name = ? # Names of serial ports on Mac OS X
  ser = serial.Serial(name)
  </code></pre>
  
  <p>How do I find out what <code>name</code> should be on a Mac?</p>
  
  <p><strong>EDIT:</strong> In response to an answer below, I'd like to find out how to access both USB to RS232 converters as well as pure USB ports.</p>