Stop popup cmd window

Thomas Heller theller at
Fri Dec 19 17:50:18 CET 2003

Dave Benjamin <ramen at> writes:

> In article <mailman.272.1071697837.9307.python-list at>,
> Fredrik Lundh wrote:
>> A console program may use the Windows API to disconnect from the
>> console, or create a window, and a window program may use the API to
>> create a console if it needs one (a version of pythonw that did this
>> if/when the application prints to sys.stderr would be quite useful,
>> btw)
> Yes! Especially if it paused afterwards, so you could actually read
> the error message! Speaking of which, is there any way to keep the
> console window on the screen after double-clicking on a .py file so
> that syntax errors don't result in a spead-reading test?

Several I can think of.

- untested, but you get the idea:

        import traceback

- set the PYTHONINSPECT env variable during runtime

- or even fire up the debugger when a problem occurs:


And, by the way, py2exe 0.5 (still officially unreleased and
undocumented) created console-less programs automatically write
exceptions into a logfile.


More information about the Python-list mailing list