I'm using easygui.multchoicebox()
to select a number of items in a tuple. How do I make a conditional that executes code when certain items from the tuple are selected?
Here is example code that does not work (nothing is returned):
from easygui import *
fieldnames = ["Yes", "No", "Maybe"]
choice = multchoicebox("Pick an option.", "", fieldnames)
if choice == fieldnames[0,1]:
msgbox('Incomplete')
if choice == fieldnames[2]:
msgbox('Complete')
It says that the list indices cannot be tuples. I changed the conditionals to strings and it did not work either (still nothing is returned):
from easygui import *
fieldnames = ["Yes", "No", "Maybe"]
choice = multchoicebox("Pick an option.", "", fieldnames)
if choice == "Yes" and "No":
msgbox('Incomplete')
if choice == "Maybe":
msgbox('Complete')
What is preventing the code from being executed? If easygui.multchoicebox()
isn't designed from this, what module is?