program path

Gerhard Häring gh at ghaering.de
Sun Jun 8 17:11:37 EDT 2003


Peter Hansen wrote:
> 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? [...]

#v+
C:\>set path=c:\tmp;%PATH%

C:\>x.py
c:\tmp\x.py
#v-

Seems to work on XP.

-- Gerhard





More information about the Python-list mailing list