[Python-3000] Windows gui vs. console

Paul Moore p.f.moore at gmail.com
Thu Feb 7 23:21:37 CET 2008


On 07/02/2008, Phillip J. Eby <pje at telecommunity.com> wrote:
> At 09:52 AM 2/8/2008 +1300, Greg Ewing wrote:
> >Would it be feasible for it to always start up as a gui
> >app, and then create its own console window (a fake one
> >if necessary) if it decides it needs one?
>
> No, because that would make it impossible to write a sane
> command-line app.  Imagine if running 'ls' always created a *new*
> console window into which its results would be written...  following
> which that console window would immediately close.
>
> That's what happens if a Windows GUI app creates its own console later.

As Phillip says. Windows console and GUI executables are completely
different in behaviour. Don't try to fight it. You need two distinct
EXEs.

(I can argue the pros and cons of Unix vs Windows behaviour all night.
I'll take whichever side you prefer. The only thing that I am sure of
is that trying to ignore the differences is always going to give you
problems.)

Paul.


More information about the Python-3000 mailing list