pythonw

Determine if a script is running in pythonw?

I would like to redirect stderr and stdout to files when run inside of pythonw. How can I determine whether a script is running in pythonw or in python? ...

Running a process in pythonw with Popen without a console

I have a program with a GUI that runs an external program through a Popen call: p = subprocess.Popen("<commands>" , stdout=subprocess.PIPE , stderr=subprocess.PIPE , cwd=os.getcwd()) p.communicate() But a console pops up, regardless of what I do (I've also tried passing it NUL for the file handle). Is there any way to do that without ...

Python freezes after computer sleep/hibernate

I have a python script that is running in the background with pythonw. If I close my laptop, it goes into sleep mode. and when I open my laptop, my program has little functionality and freezes after a couple of seconds. Is there any way that my script can tell if my computer is going into sleep mode, so that it can lie dormant and restar...