Hi i have a program written in python which uses very big loops and i am trying to get some output by using the text widget of tkinter,the problem is that tkinter waits for the function to finish the loop before showing any result at all.Is there any way to make the program show some output even though the program loop is not yet finished?
OS: Linux
OS: Linux
Code:
from Tkinter import * root=Tk() root2=Tk() text="1" x=0 def remove(): if text != '1': text.grid_remove() def clear(): global text global x remove() while 1: text=Text(root2,height=1,width=70) text.insert(END,"test%d"%(x)) text.grid(row=1,column=1) x+=1 execute=Button(root,text="execute",command=clear) execute.grid() root.geometry("+100+200") root2.geometry("+500+100") root.mainloop()
Comment