I wrote a little app that controls an experiment on a robot over a serial line. I added a TKinter window that gave out a percent completed update. It works great, so long as TKinter stays the active window. As soon as I switch to Word or Chrome, it crashed. Here's an simplified example of what I'm doing
from Tkinter import *
import time
master = Tk()
w = Label(master, text="")
w.pack()
def complicatedwhileloop():
m = 0
while m < 100:
texttodisplay = m*m
w.config(text=str(texttodisplay))
master.update_idletasks()
m = m+1
time.sleep(1)
b = Button(master, text="OK", command=complicatedwhileloop)
b.pack()
mainloop()
How can I make it so that I can monitor the progress but still use other applications.