Dec-12-2023, 08:48 PM
Hello,
I have a window created with Tkinter (see screenshot attached), but I am having issues after this one is created, specially with window.mainloop() because it does not execute my python code; the idea is to do this:
1. Show Folder processing image on the window and run the script I have for this, which is a loop that goes through arrays.
2. Once completed (1), it will do a process with Selenium and download files from the web.
3. Completed (2), it will do the data moving to specific folders
4. Show the process complete once is done.
But as mentioned before, the window.mainloop() is preventing from executing the rest of my code.
I know that exists the Thread, but if I understood properly, it would run my array function, but because of the window.mainloop() appears below, it will not show the progress as explained on items from 1 to 4.
I have a window created with Tkinter (see screenshot attached), but I am having issues after this one is created, specially with window.mainloop() because it does not execute my python code; the idea is to do this:
1. Show Folder processing image on the window and run the script I have for this, which is a loop that goes through arrays.
2. Once completed (1), it will do a process with Selenium and download files from the web.
3. Completed (2), it will do the data moving to specific folders
4. Show the process complete once is done.
But as mentioned before, the window.mainloop() is preventing from executing the rest of my code.
I know that exists the Thread, but if I understood properly, it would run my array function, but because of the window.mainloop() appears below, it will not show the progress as explained on items from 1 to 4.
import threading import tkinter as tk def my_function_arrays(): #execute the code def show_window(): windows = tk.Tk() thread = theading.Thread(target = my_function_arrays) thread.start() window.mainloop() show_window()How to do this?