Loading... 引入库:`import sys` 文件名:`test.py` ``` a=sys.arg[0] print(a) 结果输出:test.py a=sys.arg[1] b=sys.arg[2] print(a+" "+b) 运行>test.py 1 2 结果输出:1 2 a=sys.arg[1:] print(a) 运行>test.py 1 2 3 结果输出:['1','2','3'] a=sys.arg[2:]: print(a) 运行>test.py 1 2 3 结果输出:['2','3'] a=sys.arg[0:] print(a) 运行>test.py 1 2 3 结果输出:['test.py','1','2','3'] ``` Last modification:October 24, 2019 © Allow specification reprint Support Appreciate the author AliPayWeChat Like 0 如果觉得我的文章对你有用,请随意赞赏