0

I am using WinPython with Python 3.3.2 under Windows 7. I like to be able to run python programs from the command prompt simply by typing the name of the program, like program.py. This didn't work at first, requiring me to type python program.py until I set the file associations under windows to associate .py files with python. Then it worked.

However, I just discovered that if I run a program by typing the program name, I can't see any of the command line arguments in sys.argv. For instance, program.py arg1 will not show arg1 in sys.argv. All I see is the first argument, the name of the program. BUT, if I run the program by typing python.exe program.py arg1 then I can arg1.

I need command-line args, but I don't want the extra typing because I'll be running commands many times. Any idea what's wrong?

composerMike
  • 966
  • 1
  • 13
  • 30
  • possible duplicate of [Windows is not passing command line arguments to Python programs executed from the shell](http://stackoverflow.com/questions/2640971/windows-is-not-passing-command-line-arguments-to-python-programs-executed-from-t) –  Mar 03 '14 at 19:39
  • Yes, Looks like it's worth trying the suggestions on that question before further comment here. Too bad that fixing it looks like deep delving into the registry. I don't think I even have the registry editor on Windows 7 home. – composerMike Mar 03 '14 at 20:50
  • You have the registry editor, just open "Run" (with `Windows + R`) and type in `regedit.exe`. –  Mar 03 '14 at 22:53

0 Answers0