shell执行Python并传参

shell:

python test.py  a1 222

 test.py

import sys

print(sys.argv[1], type(sys.argv[1]))   # a1 str
print(sys.argv[2], type(sys.argv[2]))   # 222 str

 

posted @ 2018-11-26 15:48  web123  阅读(1273)  评论(0编辑  收藏  举报