Unix-head needs to Windows-ize his Python script (II)

Grant Edwards invalid at invalid.invalid
Tue Oct 26 10:44:11 EDT 2010


On 2010-10-26, Lawrence D'Oliveiro <ldo at geek-central.gen.new_zealand> wrote:
> In message <mailman.216.1287980107.2218.python-list at python.org>, Steve 
> Holden wrote:
>
>> and, in fact, the console is only a GUI window in a windowed system. It
>> might be one of the console emulation windows that init starts under
>> linux, or even a terminal connected to a computer by a serila line, for
>> heavens sake.
>
> But now you're no longer talking about Windows. Windows is the only
> one that gets it backwards like this, forcing the creation of GUI
> elements for non- GUI-based programs,

I've been following this entire thread, and I'm afraid I have no clue
at all waht you mean by that last phrase "forcing the creation of GUI
elements for non-GUI-based programs".

> and not for GUI-based ones.

In Windows the default for python applications is that they run in a
console session with stdin/stdout/stderr attached to a terminal
emulator.  The application itself may or may not create GUI windows on
its own -- that's independent of whether it's attached to a terminal
emulator or not.

> More reasonably-designed systems, such as you describe above, make no
> such distinction between GUI and non-GUI programs.

Sure they do.  When you create a launcher item or menu item in most
desktops, there's a setting that says whether you want the program run
in a terminal window or not.  That's exactly the same thing you're
controlling under Windows when you set the filename to .py or .pyw.

> There is no difference based on the name of your executable, how it
> is built, or what libraries it links to; the only difference is in
> its run-time behaviour, whether it invokes any GUI functions or not.

No, we're not talking about whether apps invoke GUI functions or not.
That's completely orthogonal to the issue at hand.  We're talking
about whether desktop manager should run the program with
stdin/stdout/stderr connected to /dev/null or connected to a terminal
emulator.

The windows desktop determines that (like it determines other things)
by looking at the filename.  Other desktops generally have that
information associated with the icon/button/menu-entry, not with the
executable's filename.

-- 
Grant Edwards               grant.b.edwards        Yow! And then we could sit
                                  at               on the hoods of cars at
                              gmail.com            stop lights!



More information about the Python-list mailing list