|
from sys import argv
script, first, second, third = argv
print ("The script is called:", script)
print ("Your first variable is:", first)
print ("Your second variable is:", second)
print ("Your third variable is:", third)
运行后 C:\Users\Administrator\AppData\Local\Programs\Python\Python36\python.exe D:/python/笨方法学python/case13.py
Traceback (most recent call last):
File "D:/python/笨方法学python/case13.py", line 3, in <module>
script, first, second, third = argv
ValueError: not enough values to unpack (expected 4, got 1)
上网百度过 说要在命令行 运行 python case13.py arg 1 arg2 arg 3
但是返回报错 找不到文件 |
|