filename:test.py
import sys
print(sys.version)
print(sys.argv)
I typed python test.py 1 2 3 in the cmd console , it works well.
3.5.1 (v3.5.1:37a07cee5969, Dec 6 2015, 01:54:25) [MSC v.1900 64 bit (AMD64)]
['test.py', '1', '2', '3']
However , I type test.py 1 2 3 in the cmd console, it can only get the first argument.
3.5.0b4 (v3.5.0b4:c0d641054635, Jul 26 2015, 06:55:14) [MSC v.1900 32 bit (Intel)]
['E:\\Bin\\iproc\\test.py']
How can I get these arguments ?
E:\Bin\iproc\test.pyis the right copy oftest.py? Is thecmdwindow finding one in yourPATHto run instead? The version of PYthon appears to be different, too, which hints it might a different copy.python test.py 1 2 3andimport sys print(sys.argv)that's ok tutorialspoint.com/python/python_command_line_arguments.htmtest.pyin myPATHas I runwhere test.py,only onetest.pyis the result.