I assume by eg.ynbox(msg='wat to do')
you mean you are creating a Yes/No dialog box. This means that the value stored in choice
is an Integer
where 1 represents True and 0 represents False. This is correct in both Python 2.x and Python 3.x as long as True and False have not been reassigned in Python 2.x True
and False
are reserved keywords in Python 3.x and thus are guaranteed not to change. Therefore, you simply have an if
statement that works using this value:
if choice:
print 'Yes'
else:
print 'No'
You do not need to match on 1
and 0
since they represent both True
and False
.