Command line arguments question (Windows XP)

Tim Golden tim.golden at viacom-outdoor.co.uk
Tue Mar 21 11:29:45 EST 2006


[ezd]

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

TJG

________________________________________________________________________
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:
http://www.star.net.uk
________________________________________________________________________



More information about the Python-list mailing list