I am using a Tkinter python 2.6 UI and I am trying trying to use a button to skip though an elememt in a list of commands if a particular command takes too long. Essentially I trying to execute the 'continue' statement from another function. Consider the following:
def executeCommands(commands):
for cmd in commands:
sendCommand(cmd)
#arbitrary button class used as an example
class Button(self)
#this button executes onSkip() method when clicked
self.skipBtn = Button('skip', command=self.onSkip)
def onSkip(self):
#skip to next iteration of loop that was being iterated prior to skip button execution
How would I get the executeCommands method to stop what its doing and skip to the next cmd when the onSkip method from the Button class is executed?