redirecting stdin with Python scripts under win2k (solution)

Dale Strickland-Clark dale at riverhall.NOTHANKS.co.uk
Thu Mar 14 06:38:52 EST 2002


I'm sure you're very pleased with that but I don't see the point.

If I want to run a Python program, I just type the name of it at a
command prompt.

A few prerequisites need to be in place but some of these happen
during install:

1. The directory containing the script needs to be in your PATH
environment var or be the current directory.
2. PATHEXT environment var needs to contain ".PY;.PYC;.PYW"
3. The Python exes need to be associated with the Python file types.

Once you get all the above right, you just type:

C:\> wibble args

and it runs:

"C:\Python21\python.exe" "wibble.py" args

This only works with Win NT/2K/XP. As for 95/98/ME, well it's easier
not to bother, really.

Disguising your Python programs as batch files is going to knacker any
attempt your editor may make to help with syntax highlighting and
suchlike.

Also, FYI, I think all the command extensions you mention were
introduced with NT 4.
--
Dale Strickland-Clark
Riverhall Systems Ltd



More information about the Python-list mailing list