Sounds like what is happening is that your process is busy doing work and so it doesn't relinquish any cycles to the GUI to refresh.
What you will need to do is move the busy process out to its own thread.
You will want to do something like
import threading
class Encrypt(threading.Thread):
def __init__(self, threadNum, asset, window):
threading.Thread.__init__(self)
self.threadNum = threadNum
self.window = window
self.signal = True
def run(self):
while self.signal:
do_stuff_that_is_cpu_intensive
for self.path in self.paths: #etc..
and in your main wx.Frame class:
class Frame(wx.Frame):
def __init__(self, *args, **kwargs):
super(Frame, self).__init__(*args, **kwargs)
self.InitUI()
self.Show()
self.count = 0 # simple thread counter.
self.threads = [] # this lets you iterate over your threads if you ever need to
def OnEncrypt(self):
self.count += 1
thread = Encrypt(self.count, asset, self)
self.threads.append(thread)
thread.start()
See a much more detailed method and explanation here: http://www.blog.pythonlibrary.org/2010/05/22/wxpython-and-threads/