user3840124
user3840124

Reputation: 13

Multiple Images in EasyGui

Basically I want to create type of quiz in Python 3.4 with EasyGui using multiple images on the button boxes. How I'd imagine it'd work would be like this:

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")

This works, but if I change the line

reply=eg.buttonbox("Who is this?",image=[image,image2,image3,image4],choices = choices)    

But that doesn't seem to work, does anyone know if you can have more than one image per buttonbox?

Upvotes: 0

Views: 1544

Answers (2)

LinuxFighter
LinuxFighter

Reputation: 45

allpic = ("image", "image2", "image3")

reply=eg.buttonbox("Who is this?",image=allpic,choices = choices) 

Upvotes: 1

Horst JENS
Horst JENS

Reputation: 116

at the current version of easygui, you can't have multiple images, only one image.

You could either:

  • use an external tool to create one big merged image out of several smaller images.
  • try to make the necessary changes direct inside easygui.py (it's all in one single file) if you have knowledge in tkinter
  • help / contact Robert Lugg as he works on an improved version of easygui https://github.com/robertlugg/easygui

Upvotes: 1

Related Questions