I've got a python script set to log in to a mail server and transfer the files to a remote directory mapped on my machine. Since I don't want it popping up every 10 minutes, I saved it as a pyw file. It worked fine at first, but then it stopped working, showing 0x1 as the result of the last run in the Windows Task Scheduler. When this happens I can execute the exact same code in a .py file and it works, but the .pyw file doesn't even if I run it manually.
The pyw file only works again if I add an 'os.system("pause")' line to anywhere the code, which forces a command window to pop up for that line of code. If I take that line out again, it continues to work for the rest of the day, but then when I come in the next day it's stopped working again.
I'm at wits' end on how to troubleshoot this. I'm not sure if it's an issue with pythonw, or something's going wrong with Windows Task Scheduler which is interfering with it, or something else.