1

So, I'm currently planning a program using the Easygui module,

The problem I am facing is, when I press the cancel button on the GUI, it just continues, so to get past this, I want to add something to my program like:

if Easygui_Variable is None:
    quit()

However, the problem I face is, I am going to have multiple easygui boxes which allow the user to press cancel, and I don't want to be using

if Easygui_Variable is None:
    quit()

every time, so is there anyway I can do the above for multiple variables at a time, to make sure my program is most efficient.

Thompson
  • 11
  • 2
  • 1
    store them in a list and then `quit()` on a condition like `if any(e is None for e in my_easygui_variables)`? – lemonhead Jun 30 '16 at 08:50
  • After trying this out, with the condition of: if any(e is None for e in my_easygui_variables) in a Function, I then created two of the Easygui variables where I am able to press cancel on them. I then called the function afterwards, for both variables, however, the problem I received was, it was saying the other variables in the list - that I wasn't currently calling the function for - it was saying they were undefined, even though I had stated global Variable_Name for all of them. – Thompson Jun 30 '16 at 08:59

0 Answers0