[Python-Dev] Install-on-first-use vs. optional extensions

"Martin v. Löwis" martin at v.loewis.de
Wed Sep 8 20:28:12 CEST 2004

Guido van Rossum wrote:
> I frequently use the extension feature in a console context; when I am
> in a directory full of .py files, I can run any one of them by simply
> typing its name (and possibly command line arguments). The script will
> then interact through the existing console window. WIll this work?

No. I didn't (really) know that was possible (although Mr Rivest's
bug report should have taught me).

I've tried to fix it, and now think this is impossible: Even though
XP provides an AttachConsole call (which doesn't exist in earlier
releases or W9x), which allows to write in the console from which
the binary was started, there is apparently no way to tell cmd.exe
that it should wait for completion, instead of immediately giving
a prompt.

I have now reverted the change to create launcher.exe, and install
python.exe and pythonw.exe twice (the second time as extpy.exe and

P.S. Out of curiosity, and to the WINDOWS GURUS ON THIS LIST:
How does cmd.exe know whether the program started is a console
application or not? Is there any API for that? Just looking at
the file being run is clearly insufficient - if the file is
foo.py, it needs to look at python.exe.

More information about the Python-Dev mailing list