It is pretty ugly having to declare each variable as global (otherwise, the framework crashes), and also initiating the function. I mean, this is what the code ends up like
Code:
var = 1 def
var = 1 def
if variable:
print 'returning to main program'
# stop executing more code in this file
# and return to the main program
else:
pass
# more code goes here
print 'the rest of the code was executed'
text = Text(root)
text.grid()
text.bind('<Key>', compare)
def compare(args*):
# check the text
Leave a comment: