0

Hi guys I'm learning to use easygui for my school project, and for some boxes in easygui there's a "Cancel" button, to tap which will return a None value, which is quite troublesome to deal with especially in string processing. I wonder if there's any way to disable this "Cancel" button and show only "OK" button to force user not to return me the None value, or at least, change the default return value of Cancel to space or something else. Thank you!

a = easygui.choicebox(choices=[1,2,3])
# to tap "Cancel" button, a==None will be true, with the choicebox closed.
ryrn
  • 1
  • It's not harder to check for none value than to check for empty string – Achille G May 18 '22 at 14:26
  • oh i can use a ```a if b else c``` pattern to convert the None value – ryrn May 18 '22 at 14:30
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community May 21 '22 at 09:18

0 Answers0