title: Python error in creating serial port
body: <p>I am having a problem in running a python script. The python script reads a serial port. When running a script I am getting following error</p>
  
  <pre><code>File "C:\Python26\lib\site-packages\serial\serialwin32.py", line 268, in flushInput
   if not self.hComPort: raise portNotOpenError
   ValueError: Attempting to use a port that is not open
  </code></pre>
  
  <p>My python script to create a serial port is</p>
  
  <pre><code>ser = serial.Serial(11, 115200,timeout=1)
  ser.setWriteTimeout(1)
  print ser.portstr
  ser.flushInput()
  ser.flushOutput()
  </code></pre>
  
  <p>I am getting error in <code>ser.flushInput()</code></p>
  
  <p>Can anyone let me know why is this error generating and how to resolve this?</p>