Weird invisible arguments issues with Windows

Chris Hulan chris.hulan at gmail.com
Thu Jan 29 18:11:04 CET 2009


On Jan 29, 11:35 am, Uberman <bhoo... at hotmail.com> wrote:
> I've installed Python 2.6.1 (AMD64) under Windows Vista Ultimate 64-bit.
>
> First off, it didn't register the extension for .PY (although it did register
> .PYC).
>
> After manually associating the .PY extension with the python.exe executable, I
> am now getting some weirdness on the command line.  When I run the following
> script, saved as "build.py", by simply entering "build.py -r -d" on the
> command line, it produces the output "1":
>
>     import sys
>     if __name__ == "__main__":
>         print len(sys.argv)
>
> It doesn't see the additional arguments for some reason.  However, if I
> execute the script by prefixing it (i.e., "python build.py -r -d"), I get an
> output of "3", meaning it sees the additional arguments.
>
> Has anybody else run into this issue?  And perhaps (hopefully) solved it?

Have seen this in some installs on XP. Indicates the registry entry
that specfies how to
invoke python on a *.py file is not correctly set to pass along the
command line arguments

on my XP system, in the registry under HKEY_CLASSES_ROOT\Applications
\python.exe\shell\open\command
has:
Name (Default)
Type REG_SZ
Data C:\Python23\python.exe "%1" %*

If that '%*' is missing, thats the problem

Cheers
Chris






More information about the Python-list mailing list