Duncan Booth <du**********@invalid.invalid> wrote:
Fredrik Lundh wrote:
footnote: if you'd prefer to type "myscript myarg" instead, you might
want to check out this tool:
http://effbot.org/zone/exemaker.htm
or even just do:
SET PATHEXT=.py;%PATHEXT%
and then "myscript myarg" will work for all scripts on your path without
compiling (if you don't set PATHEXT then "myscript.py myarg" will still
work, and tab completion means you don't generally need to type the .py for
scripts in the current directory).
The downside to this is that there is a bug in the NT/2K/XP command
interpreter which will prevent redirecting from stdin in that case. That
is:
C:\Tmp>type x.py
import sys
print sys.stdin.readline()
C:\Tmp>echo 123 | python x.py
123
C:\Tmp>echo 123 | x.py
The process tried to write to a nonexistent pipe.
C:\Tmp>python x.py < x.py
import sys
C:\Tmp>x.py < x.py
C:\Tmp>
--
- Tim Roberts,
ti**@probo.com
Providenza & Boekelheide, Inc.