I have a very simple python script that uses pySerial to send data over the serial port to my arduino. When I execute this line-by-line in the python shell, it works just fine, but when I put it in a ".py" file, and try to run it, nothing happens. Though the Serial lights on my UART do flash. So something is getting through, but it's garbage (I checked).
Here is the simple code.
import serial
ser = serial.Serial('COM3',9600,timeout=.2)
ser.write('A')
ser.close()
I've already tried adding sleeps, but nothing seems to be fixing it. Any ideas?