python中argv的使用
from sys import argv
input(argv)
script,first,second,third = argv
print("The script is called:",script)
print("Your first varilable is:",first)
print("Your sencond variable is:",second)
print("Your third variable is:",third)
这段代码在pycharm 运行出错,提示代码:
Traceback (most recent call last):
File "C:/Users/Administrator/PycharmProjects/ex1.py/ex13.py", line 4, in <module>
script,first,second,third = argv
ValueError: not enough values to unpack (expected 4, got 1)
在命令行中输入 python ex13.py 1 2 4 出现无效语法错误 怎么解决 命令行编辑python程序