title: Pyserial problem with Arduino - works with the Python shell but not in a program
body: <p>All right, so I am positive my Arduino circuit is correct and the code for it. I know this because when I use the serial monitor built into the Arduino IDE and send 'H' an LED lights up, when I send 'L' that LED turns off.</p>
  
  <p>Now I made a Python program </p>
  
  <pre><code>import serial
  ser = serial.Serial("COM4",9600)
  ser.write("H")
  </code></pre>
  
  <p>When I run the code the LED blinks on for a second then goes back off.
  However when I do each of these lines separately in the shell it works just like it is supposed to.</p>
  
  <p>Any ideas?</p>