Code Yarns ‍👨‍💻
Tech BlogPersonal Blog

Python: Ignoring Commandline Parameters

📅 2010-Aug-09 ⬩ ✍️ Ashwin Nanjappa ⬩ 📚 Archive

After changing Python installations on Windows, you may find that Python is ignoring the commandline parameters passed to a Python script.

To fix this, open regedit.exe, head over to HKEY_CLASSES_ROOT\Applications\python.exe\shell\open\command and make sure the value field is "C:\PYTHON_PATH\python.exe" "%1" %*. If the %* is missing, then the Python script will not have access to the commandline parameters passed to it.