On Tue, Jul 27, 2010 at 09:36, <pyt...@bdurham.com> wrote: > Windows: How can I detect whether a Python app/script is running in > console/GUI mode? By app I mean a script compiled to an exe via py2exe or > similar. > > Thank you, > Malcolm >
I don't remember much about py2exe, but you could check if ``os.path.split(sys.executable)[1]`` equals pythonw.exe (typical for GUIs) or just python.exe (regular console).
-- http://mail.python.org/mailman/listinfo/python-list