Message126229
I finally found a solution from a page on StackOverflow.
I had to add the two characters %*
to the end of the Data value for the Windows registry key:
HKEY_CLASSES_ROOT\Applications\python.exe\shell\open\command
So the Data value is now:
"C:\Python26\python.exe" "%1" %*
just as it appears above including the two sets of double quotes.
I had modified or added six other keys but only the one above solved the problem.
I am running Python 2.6 under MS Windows Vista Home Premium 32 bit.
For completeness I tested potential fixes as follows:
I had a program show_args.py which had the two lines:
import sys
print 'argv length is ', len(sys.argv)
In order for show_args.py to receive args from the command line invocation (before I did the registry fix) I had to explicitly call the python interpreter, so ...
Before the fix:
C:\...>python show_args.py aaa bbb ccc
argv length is 4
C:\...>show_args.py aaa bbb ccc
argv length is 1
After the fix:
C:\...>show_args.py aaa bbb ccc
argv length is 4
In hindsight I should have searched the registry for python paths that didn't have the ending %*.
Very briefly, for those unfamiliar with Windows' RegEdit:
Click the Start button and enter regedit in the Search box and the Regedit.exe name will appear in the list above - click it.
Repeatedly do Edit/Find python.exe
until you find a python path of the form: ...\python.exe" "%1"
instead of the form ...\python.exe" "%1" %*
In the right pane of Regedit, under Name click the word (Default), it will turn blue, then select Edit/Modify...
Simply add a space and the two chars %* to the end of the entry in the Value data box, then click OK.
Changes take effect immediately; you don't have to reboot or re-open your prompt window, but if you are using IDLE or another IDE you probably have to close and restart it. |
|
Date |
User |
Action |
Args |
2011-01-14 05:29:50 | bill_sanjose | set | recipients:
+ bill_sanjose, loewis, amaury.forgeotdarc, mark.dickinson, eric.smith, eric.araujo, JT.Johnson, tomzych, Sworddragon, jiri.kulik, pierrebourgault |
2011-01-14 05:29:50 | bill_sanjose | set | messageid: <1294982990.37.0.338638306205.issue7936@psf.upfronthosting.co.za> |
2011-01-14 05:29:46 | bill_sanjose | link | issue7936 messages |
2011-01-14 05:29:45 | bill_sanjose | create | |
|