Stop popup cmd window

Fredrik Lundh fredrik at
Wed Dec 17 22:37:41 CET 2003

Derrick 'dman' Hudson wrote:

> > Thanks for the tip... that did it. I need to read up on the difference
> > between python.exe and pythonw.exe.

Same program, linked in different ways.  See below.

> The difference is a Microsoft one.  The former has stdin, stdout and
> is a normal program.  Microsoft dictates that on Windows such programs
> must have a black window appear for the life of the program.

Programs linked for the "console" subsystem (aka "character-mode
applications") have to be connected to a console window.  If they're
not, Windows creates one for them.

(I'm pretty sure this is done by the loader and not the C runtime).

> The latter is an "MFC" (or whatever the proper term is)

The "windows" subsystem.

> The difference is the specific functions the C runtime calls to notify
> Windows of which sort of app it is during startup.

A linker option, usually (/subsystem)

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)


More information about the Python-list mailing list