I am having trouble getting a Python program I created to run in Python's windowless mode (.pyw).
The program reads serial information from an Arduino and, based on what is received, rotates the screen.
In normal mode (.py) it runs properly. It reads the serial information and acts until the program is closed by a user.
In windowless mode (.pyw) it seems to run once and stop.
What is wrong?
import serial
import os
ser = serial.Serial('COM3', 115200)
orientation = "Null"
while True:
comparison = str.strip(ser.readline())
#Strip necessary for string comparison and for formatting.
print comparison
if (comparison=="Landscape") and (orientation != "Landscape"):
print "Success Landscape!"
os.system("start "+"C:\Display\One-0")
orientation = "Landscape"
elif comparison=="Portrait" and (orientation != "Portrait"):
print "Success Portrait!"
os.system("start "+"C:\Display\One-90")
orientation = "Portrait"