I used Tkinter to create a simple UI for my python script. It's quite a long program and once the user clicks on a button, it takes at least 5 mins to finally create the output Excel sheet. In the meanwhile, I want to use the text widget to keep the user informed of the status. But when I use text.insert(index,'Fetching rates...\n') everytime, the text widget gets validated only when the whole execution completes and the cursor remainis in sandclock mode the whole time. Please help out.
Add a comment
|
1 Answer
As like most GUI systems, Tkinter is basically a single threaded system.So,when the operation begins in Excel sheet,your GUI stops responding.Try using update_idletasks() if you want to force the GUI to show the text.
For more details,visit this
8 Comments
Alok
you are welcome buddy ;). You should try the make the whole UI responsive though
raul
I'm a newbie. Could you elaborate?
Alok
What i'm trying to say is you should try to use root.update_idletasks or frame.update... or canvas.update... or whatever it is you are using so that your whole UI is responsive & not just the text area
raul
hey, why does the application go gray (title bar says 'Not Responding') when I click anywhere on the window when idletasks is doing its job?
Alok
that means your
update_idletasks is not doing its job properly,which means you haven't used it well. Like i said yesterday,don't use it with a widget,but with the root or frame or canvas. |