program path

Peter Hansen peter at engcorp.com
Sun Jun 8 14:10:10 EDT 2003


Gerhard Häring wrote:
> 
> Peter Hansen wrote:
> > Can anyone with access to a WinNT/XP machine that can invoke
> > scripts without explicitly specifying "python.exe" in the
> > command line add to this?
> 
> #v+
> C:\>copy con: tmp\x.py
> import sys
> print sys.argv[0]
> ^Z
>          1 file(s) copied.
> 
> C:\>tmp\x.py
> C:\tmp\x.py
> 
> C:\>ver
> 
> Microsoft Windows XP [Version 5.1.2600]
> #v-

Thanks Gerhard, but could you please try running it via
a directory available only via PATH?

Explicitly specifying the directory should always lead
to sys.argv[0] containing the "as invoked" name, but we're
not sure what would happen if it's found via the PATH.

-Peter




More information about the Python-list mailing list