Determine if a script is running in pythonw?

1.5k Views Asked by At

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?

1

There are 1 best solutions below

4
On BEST ANSWER

sys.executable -- "A string giving the name of the executable binary for the Python interpreter, on systems where this makes sense."