title: Python serial port status
body: <p>How do you know the status of a serial port in Python prior to opening the serial port?</p>
  
  <p>I know I can use the following code below, to determine its status, but this required the port to be already open.</p>
  
  <pre><code>if self.ser.isOpen():
  </code></pre>
  
  <p>The reason I ask, is sometimes when I execute my code I get a serial exception stating that the port is already open, in this case, I want to know before hand and try to close it before opening it.</p>