Q:

How to sequence threaded tasks in Python/wxPython

Relative newcomer to wxPython and threading, hence confusion.
I have 5 "steps" that must be performed on my target data.  The steps must be performed sequentially in a given order.
In order to keep the GUI responsive, I've coded each step as an individual thread.
When I step through the process manually (using a button to start each step) I can watch each step update the display when finished.
I'm lost as to how to automate the calling of each of the threads sequentially.  If I were to create a button labeled "Do all 5 steps in a row", what would the code called by the button look like?
I've tried simply calling each of the threaded methods sequentially, but they all attempt to operate on the data at once.  Each thread uses a 'with' and a threading.Lock() to prevent other threads from accessing the data while a given thread is running, but the threads do not appear to be executing in the correct order.
What is the proper way to write 
call_thread1()
call_thread2()
call_thread3()
..etc.
that will always execute the threads in the given order and only after each thread is done without blocking wx?

A:

Have a waiting step member of your gui as a list and a thread finished handler that if there is a next task pops it off the list and starts the thread.
In __init__(self) :
   self.TaskList = []

In OnDoAllClicked(self, evt):
   self.TaskList.extend([call_thread1, call_thread2, call_thread3, etc])
   CheckNextTask()

In CheckNextTask(self) :
   if len(self.TaskList) > 0:
      current = self.TaskList[0]
      del self.TaskList[0]
      current(callback=self.CheckNextTask)

In each thread: 
   while not Done:
      # Do whatever
   wx.CallAfter(callbacK)

