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

Nobody nobody at nowhere.com
Thu Oct 28 15:15:53 EDT 2010


On Thu, 28 Oct 2010 12:54:03 +1300, Lawrence D'Oliveiro wrote:

>>> Why would you want both CLI and GUI functions in one program?
>> 
>> An obvious example was the one which was being discussed, i.e. the Python
>> interpreter.
> 
> But the Python interpreter has no GUI.

It may have one if you use wx, tkInter, etc. So far as the OS is
concerned, it's all python.exe or pythonw.exe.

>> Forcing a program to choose between the two means that we need both
>> python.exe and pythonw.exe.
> 
> And yet we get by just fine without this dichotomy on more rationally-
> designed operating systems.

For some definitions of "fine". A GUI-based launcher doesn't know whether
the program it's being asked to run actually needs stdin/stdout/stderr.
Either it spawns an xterm (etc) even if it's not necessary, or it doesn't
and the user can't communicate with the program, or it uses some arbitrary
set of heuristics ("does the program link against Xlib?", which fails if
the GUI portion is loaded dynamically).

>> A less obvious example is a program designed to use whatever interface
>> facilities are available. E.g. XEmacs can use either a terminal or a GUI
>> or both.
> 
> And yet it manages this just fine, without Amiga-style invocation hacks, on 
> more rationally-designed operating systems. How is that?

Typically by not letting you usefully run terminal-based programs from
the GUI without first having to explicitly configure the invocation
options (e.g. creating a shortcut with "Use terminal" enabled).




More information about the Python-list mailing list