Answer the question
In order to leave comments, you need to log in
Installing Python 3.6 on Win 32 issue with extensions and command line arguments on startup?
If run like this: script.py arg1 arg2 argN
, then no arguments will be passed,
and if like this: python.exe script.py arg1 arg2 argN
, then they will.
How to make, that in the first case arguments were transferred?
Editing
HKEY_CLASSES_ROOT\Applications\python.exe\shell\open\command
brought no result. import sys
print("arguments:", str(len(sys.argv)))
for arg in sys.argv: print(arg)
D:\>script.py arg1 arg2 argN && python.exe script.py arg1 arg2 argN
arguments: 1
D:\script.py
arguments: 4
script.py
arg1
arg2
argN
D:\>py
"py" не является внутренней или внешней
командой, исполняемой программой или пакетным файлом.
Answer the question
In order to leave comments, you need to log in
1. Solution: to pass arguments:
[HKEY_CLASSES_ROOT\pyw_auto_file\shell\open\command]
@="\"C:\\Users\\Alexey\\AppData\\Local\\Programs\\Python\\Python36-32\\pythonw.exe\" \"%1\" %*"
[HKEY_CLASSES_ROOT\Applications\pythonw.exe\shell\open\command]
@="\"C:\\Users\\Alexey\\AppData\\Local\\Programs\\Python\\Python36-32\\pythonw.exe\" \"%1\" %*"
[HKEY_CLASSES_ROOT\py_auto_file\shell\open\command]
@="\"C:\\Users\\Alexey\\AppData\\Local\\Programs\\Python\\Python36-32\\python.exe\" \"%1\" %*"
[HKEY_CLASSES_ROOT\Applications\python.exe\shell\open\command]
@="\"C:\\Users\\Alexey\\AppData\\Local\\Programs\\Python\\Python36-32\\python.exe\" \"%1\" %*"
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question