I have seen this thread (and many others) but I am still not able to retrieve the args in python.
1) With this...
Run Cmd \k "Python C:\my.py %myvar%"
... a Cmd is open but nothing happens : my.py isn't started.
2) With this...
Run C:\my1.py %myvar%
... the python script is run but when I retrieve the args with sys.argv
, I only get the path of the script not myvar
. Len(sys.arg) return 1 so myvar isn't passed down to python.
sys.argv[0] will be your script path, your argument should be from sys.argv[1]
– Inheritorsys.argv[1]
is %myvar% provided that there aren't spaces – Ferrocenelen(sys.arg)
returns 1, I don't have asys.argv[1]
. – Warrigalpython C:\myscript.py sometext
. – Warrigal