import sys
print(sys.argv)
将这段代码另存为test.py,windows中打开cmd,其他打开对应的终端,输入:
python test.py 1231223
运行效果(Power Shell):
PS C:\Users\Sphaera\Desktop> python test.py 1231223
['test.py', '1231223']
PS C:\Users\Sphaera\Desktop>
import sys
print(sys.argv)
将这段代码另存为test.py,windows中打开cmd,其他打开对应的终端,输入:
python test.py 1231223
运行效果(Power Shell):
PS C:\Users\Sphaera\Desktop> python test.py 1231223
['test.py', '1231223']
PS C:\Users\Sphaera\Desktop>