Command line arguments in Windows

Chris cwitts at gmail.com
Tue Mar 4 03:27:32 EST 2008


On Mar 4, 8:38 am, "Mike Walker" <mhwal... at shaw.ca> wrote:
> > If you run a python file, ie. just double clicking it the only
> > argument you will have will be the filename of the script.  If you
> > create a shortcut to the script and in the target box add your
> > arguments (if you have quotation marks place them after not inside)
> > you will see your arguments.  fwiw you answered yourself in the third
> > paragraph.
>
> As I mentioned I am working from the command line, not clicking on the icon.
> The only difference between it working and not is the python prefix, which
> is why I was thinking this is some sort of file association problem.
>
> I probably wasn't as clear as I could have been in the third paragraph.
>
> argtest.py arg1 arg2 arg3 - Does not work only get sys.argv[0]
> python argtest.py arg1 arg2 arg3 - Works

That seems rather wierd, just running argtest.py arg1 arg2 arg3 I get
the correct output, Python 2.5.1 from python.org but running on XP
though.  Potentially an issue with Vista... ?



More information about the Python-list mailing list