Detecting a GUI session

Leith Bade leith.bade at silentone.com
Wed Jan 7 19:11:32 EST 2009


I would like to know whether my GUI program is being run under python or
pythonw.
 
I would like to know this so I can redirect stderr when their is no
console window (pythonw) otherwise leave it spitting to the console
window (python).
 
This is because I debug using python while the customer release build
uses pythonw.
 
I can see their is sys.executable but a google search turned up various
discussions on what this actually means (e.g when run under an
integrated exe file - which we do for our release builds).
 
Leith Bade
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20090108/5b9a61eb/attachment.html>


More information about the Python-list mailing list