请教各位大神python报这个错怎么解

 我来答
从空去听8
2017-10-05 · TA获得超过7440个赞
知道大有可为答主
回答量:6907
采纳率:93%
帮助的人:5590万
展开全部
from sys import argv
script,user_name = argv
prompt = '> '
print("Hi %s,I'm the %s script."%(user_name,script))
print("I'd like to ask you s few questions.")
print("Do you like me %s?"%user_name)
likes = input(prompt)
print("Where do you like %s?"%user_name)
lives = input(prompt)
print("What kind of computer do you have?")
computer = input(prompt)
print("""
Alright,so you said %r about liking me.
You libe in %r.Not sure where that is.
And you have a %r computer.Nice.
""" %(likes,lives,computer))
报错:
Traceback (most recent call last):
File "ex14.py", line 3, in
script,user_name = argv
ValueError: not enough values to unpack (expected 2, got 1)

错误不是说了吗 ,右一个两个参数,你只有一个,第一个参数是argc 第二个才是argv
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式