Is there a way to tell if a script has been run by Pythonw.exe instead of Python.exe?

Graham Dumpleton Graham.Dumpleton at gmail.com
Thu Oct 18 19:16:26 EDT 2007


On Oct 19, 7:56 am, Metalone <j... at iteris.com> wrote:
> In particular I want to know how to tell if reading and writing to the
> console can occur.
> Something like
> sys.isConsolePresent()

Have you tried:

  sys.stdin.isatty()
  sys.stdout.isatty()

Graham




More information about the Python-list mailing list