2

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?

Georg Schölly
  • 124,188
  • 49
  • 220
  • 267

1 Answers1

5

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

Steve Gilham
  • 11,237
  • 3
  • 31
  • 37