基本上我想用EasyGui在Python 3.4中使用按钮框上的多个图像创建测验类型。 我怎么想象它的工作是这样的:
import easygui as eg
# A welcome message
eg.msgbox ("Welcome to the quiz", "Quiz!")
# A short splash screen this could be looped
Finish = "Start"
while Finish == "Start":
Finish = eg.buttonbox("Do you want to start the quiz or quit?","Welcome",["Start","Quit"])
if Finish == "Quit":
break
#Question 1
image = "mickey.gif"
choices = ["Mickey","Minnie","Daffy Duck","Dave"]
reply=eg.buttonbox("Who is this?",image = image,choices = choices)
if reply == "Mickey":
eg.msgbox("Well done!","Correct")
else:
eg.msgbox("Wrong","Failure")
这样可行,但如果我更改了行
reply=eg.buttonbox("Who is this?",image=[image,image2,image3,image4],choices = choices)
但这似乎不起作用,有人知道每个按钮盒是否可以有多个图像吗?
答案 0 :(得分:1)
在当前版本的easygui中,您不能拥有多个图像,只能拥有一个图像。
你可以:
答案 1 :(得分:0)
allpic = ("image", "image2", "image3")
reply=eg.buttonbox("Who is this?",image=allpic,choices = choices)