Command line arguments question (Windows XP)

Tim Golden tim.golden at
Tue Mar 21 17:29:45 CET 2006


| #
| import sys
| print 'args',sys.argv
| in "Command Prompt" window, with 2 command lines on 2 PCs:
| # Case (1L):
| C:\tmp> a b c
| args ['C:\\tmp\\']
| # Case (1D):
| C:\tmp> a b c
| args ['C:\\tmp\\', 'a', 'b', 'c']

Almost certainly means that the association between
.py files and the python executable has been set up
differently. Try typing (as the command shell):

assoc .py
=> .py=Python.File

ftype Python.File
=> python.file="C:\Python24\python.exe" "%1" %*

Now if they don't look like that, in particular if the
second one looks like this:

python.file="C:\Python24\python.exe" "%1"

then the extra parameters (everything after the script filename)
won'e get passed along to the interpreter.


This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:

More information about the Python-list mailing list