代码
a = sys.argv
b = len(sys.argv)
print(a)
print(b)
a = sys.argv[0]
b = sys.argv[1]
c = sys.argv[2]
print("filename:", a)
print("param1:", b)
print("param2:", c)
执行
python sendDisableProperty_value_back_id.py a b c
result
['sendDisableProperty_value_back_id.py', 'a', 'b']
3
filename: sendDisableProperty_value_back_id.py
param1: a
param2: b
其他链接
https://blog.csdn.net/cadi2011/article/details/84638659