我在脚本中得到ValueError

问题描述 投票:-1回答:1

我越来越 valueError 在这个代码中。我不知道为什么?

from sys import argv
(script,first,second,third)=argv

print('The script is called:',script)
print('The first variable is :',first)
print('The second variable is :',second)
print('The third variable is :',third)
python argv
1个回答
1
投票

你要么是没有提供足够的参数来运行你的脚本,要么是提供了太多的参数,你需要提供三个像这样的参数。

python3 script.py first second third
© www.soinside.com 2019 - 2024. All rights reserved.