maintain 2 versions of python on my computer

Alf P. Steinbach alfps at start.no
Sat Jan 16 18:25:16 EST 2010


* Gertjan Klein:
> Alf P. Steinbach wrote:
> 
>> * Gertjan Klein:
>>> Alf P. Steinbach wrote:
>>>
>>> Thinking about it some more, perhaps that way I can't get at return
>>> codes a python script might provide. I haven't used those, but they may
>>> be useful at some point.
>> Return codes work OK no matter what.
> 
> Ok, I won't have to worry about that then. ;-)
> 
>> But it's a hassle for the user to connect up standard input, standard output and 
>> standard error for a GUI subsystem process.
> 
> Good point. Two executables it is. But out of curiousity, what happens
> when a user pipes something into a GUI subsystem executable?

The same as with a console program, I guess.

Indeed piping is one way to connect up the output.

Disclaimer: I can't recall ever actually trying to pipe input to a GUI subsystem 
exe. However, piping output, while not common, at least I've done that! :-)


>> Perhaps do this in JScript or VBScript (languages bundled with Windows)? There 
>> may be less startup overhead than with Python. But I haven't checked.
> 
> Won't these create a DOS window, always?

No. They're run via the Windows Script Host interface. WSH has two runner 
programs: cscript (console) and wscript (GUI). So you get a console window (it's 
tehnically not DOS although the icon was MS-DOS until and including Windows NT 
4.0) if you run a [.js] or [.vbs] file via cscript, and not via wscript.

wscript is the default.

But you can change that association, or create new associations, via the Windows 
'assoc' and 'ftype' commands (note that after some XP update 'ftype' is no 
longer able to delete associations, it must then be done directly in registry).


>Or can they run windowless as well?

Yes, see above.


> If so, that might be an option worth exploring as well.



Cheers & hth.,

- Alf



More information about the Python-list mailing list