Python Forum
[Tkinter] How to do this with Tkinter?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Tkinter] How to do this with Tkinter?
#1
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.

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?

Attached Files

Thumbnail(s)
   
Reply


Messages In This Thread
How to do this with Tkinter? - by emont - Dec-12-2023, 08:48 PM
RE: How to do this with Tkinter? - by deanhystad - Dec-12-2023, 09:04 PM
RE: How to do this with Tkinter? - by emont - Dec-12-2023, 09:51 PM
RE: How to do this with Tkinter? - by menator01 - Dec-12-2023, 10:02 PM
RE: How to do this with Tkinter? - by deanhystad - Dec-12-2023, 10:11 PM
RE: How to do this with Tkinter? - by emont - Dec-22-2023, 03:51 PM
RE: How to do this with Tkinter? - by Gribouillis - Dec-13-2023, 05:52 AM
RE: How to do this with Tkinter? - by emont - Dec-22-2023, 03:52 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020