[Tutor] Where Does the DOS Window Come From?

Marc Tompkins marc.tompkins at gmail.com
Wed Sep 24 18:52:54 CEST 2008

> I'm looking at a GUI application that I hope to modify in the next few
>> weeks. When it's executed the expected GUI appears along with a DOS window.
>> Occasionally, I think, I've seen something put in the DOS window. How do I
>> stop it from appearing and how do I find why it's used?
> If you don't want the DOS window, you can change the extension of the file
> to .pyw instead of .py, but in this case you will not see the messages
> printed by the print statement.

Not to be pedantic, but that's NOT a DOS window, it's a Python terminal.
(It just happens to be black-and-white, 80x25 character mode, the same as
DOS - but that's just because DOS was originally designed to use the same
monitor as an IBM terminal.)  You'd get the same thing under Linux or OS X.

But yes, to amplify what others have said - you can invoke the script with
"pythonw script.py", or just change its extension to ".pyw" and it will
automatically be opened with pythonw (assuming that your file associations
have been set correctly, which it sounds like they have.)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20080924/097ce134/attachment.htm>

More information about the Tutor mailing list