When you execute a script without typing "python" in front, you need to know two things about how Windows calls the program. First you need to find out which Windows file considers:
C: \> assoc .py
.py = Python.File
Next, you need to know how Windows performs actions with this extension. It is associated with the file type "Python.File", so this command shows what it will do:
C: \> ftype Python.File
Python.File = "c: \ python26 \ python.exe" "% 1"% *
So, on my machine, when I type โblah.py fooโ, it will execute this exact command without any difference in results than if I typed the whole thing myself:
"c: \ python26 \ python.exe" "blah.py" foo
If you type the same thing, including quotation marks, then you will get results identical to when you simply type "blah.py foo". Now you are able to figure out the rest of your problem for yourself.
(Or post more useful information in your question, for example, actual cut and paste copies of what you see on the console. Note that people who do such things vote for their questions and get reputation points, and more people probably help them with good answers.)
Introduced from comments:
Even if the assoc and ftype attributes display the correct information, it may happen that the arguments are disabled. What might help in this case is a direct fix to the appropriate registry keys for Python. Set
HKEY_CLASSES_ROOT\Applications\python26.exe\shell\open\command
for:
"C:\Python26\python26.exe" "%1" %*
Probably, earlier, %* absent. Similarly, set
HKEY_CLASSES_ROOT\py_auto_file\shell\open\command
to the same value. See http://eli.thegreenplace.net/2010/12/14/problem-passing-arguments-to-python-scripts-on-windows/
HKEY_CLASSES_ROOT\Applications\python.exe\shell\open\command The registry path may differ, use python26.exe or python.exe or depending on what is already in the registry.
HKEY_CLASSES_ROOT\py_auto_file\shell\open\command