lundi 18 juillet 2016

Directly calling associated script with arguments

In Windows console if I execute this script (test.py):

import sys
print(sys.argv)

like:

>python test.py my args

I get expected output:

['test.py', 'my', 'args']

but if I call it directly, like this:

>test.py my args

I get: ['C:\temp\test.py'] output, as if I didn't pass any arguments. Why?

FYI:

>assoc | findstr .py=
.py=Python.File

>ftype Python.File
Python.File=C:Python35python.exe "%1" %*

Aucun commentaire:

Enregistrer un commentaire