title: Using Serial on Python / Win7
body: <p>I am trying to interface with a serial WWAN modem (for diagnostics /signal strength measurement purposes). This is via the onboard COM1 (115200-8-n-1) on my desktop, the connection works via PuTTY. I can script the AT commands using Python, but I am having a tough time getting it to open the serial port . </p>
  
  <p>I have installed Python 2.7.1 and PySerial according to instructions. I am the local administrator of my machine and have run Python with and without admin privileges, but I get the following when I try to open the port:</p>
  
  <pre><code>Python 2.7.1 (r271:86832, Nov 27 2010, 17:19:03) [MSC v.1500 64 bit (AMD64)] on win32
  Type "help", "copyright", "credits" or "license" for more information.
  &gt;&gt;&gt; import serial
  &gt;&gt;&gt; s = serial.Serial(
  ...     port='COM1',
  ...     baudrate=115200
  ... )
  &gt;&gt;&gt; s.open()
  Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
    File "C:\Python27\lib\site-packages\serial\serialwin32.py", line 56, in open
  raise SerialException("could not open port %s: %s" % (self.portstr, ctypes.W
  inError()))
  serial.serialutil.SerialException: could not open port COM1: [Error 5] Access is
   denied.
  </code></pre>
  
  <p>It is my understanding that 8-N-1 is the default, and even when I try to set them manually it throws the same exception. </p>
  
  <p>Can anyone offer advice? 
  Thanks in advance.</p>