sys
import
sys
print
(sys.argv)
#输出
$ python test.py helo world
[
'test.py'
,
'helo'
,
'world'
]
#把执行脚本时传递的参数获取到了
sys
import
sys
print
(sys.argv)
#输出
$ python test.py helo world
[
'test.py'
,
'helo'
,
'world'
]
#把执行脚本时传递的参数获取到了
转载于:https://www.cnblogs.com/jiansg180/p/9929171.html