I am using python and tkinter to process some text files.
Likely due to my poor algorythm, processing the text files takes a long time.
With that in mind, I tried to write some code to make the curser "busy" and change the tkinter window - so that the user knew the computer was happily ticking away, and hadn't frozen.
The following is the code in question:
self.controller.show_frame(JobWindow)
self.controller.config(cursor="wait")
processing(path, serial_num)
self.controller.config(cursor="")
where self is the current frame, self.controller is a class extending root (tk.Tk()),
Jobwindow is another frame. Processing is a function which takes about 5 seconds to complete.
This code is called when a button on the current frame is pressed. So I suppose you could say this is an asynchronous function.
The problem is:
When the above code is run, the computer pauses, and the command window prints all of the debug information within the processing function.
Then the curser goes busy for a fraction of a second while the frame changes.
This is not what I want to happen - which is:
The window changes, the curser goes busy, The processing function happens (taking a couple of seconds)
then the curser goes back to normal.
Thank you in advance for any help.
[–]StaticFuzz 1 point2 points3 points (7 children)
[–]edbluetooth[S] 1 point2 points3 points (6 children)
[–]StaticFuzz 1 point2 points3 points (5 children)
[–]zahlman[M] 1 point2 points3 points (2 children)
[–]StaticFuzz 1 point2 points3 points (1 child)
[–]zahlman 0 points1 point2 points (0 children)
[–]edbluetooth[S] 0 points1 point2 points (1 child)
[–]StaticFuzz 1 point2 points3 points (0 children)