I am quite new in python and made a Tkinter application that will execute all python files existing in the directory when pressed the start button. My GUI also has progressbar to see the current progress.
so here is my code
import os
from tkinter import *
from tkinter.ttk import *
from tkinter import messagebox
directory = dir_path = os.path.dirname(os.path.realpath(__file__))
files = os.listdir(directory)
root = Tk()
root.geometry('200x200')
root.maxsize(200,200)
root.minsize(200,200)
root.title('PYTOEXE')
v = 0
def begin():
global v
for x in files:
os.system('pyinstaller '+x)
v=v+1
p['value']=v
p = Progressbar(root,length=200,max=len(files))
b = Button(root,text="Start",command=lambda: begin())
p.place(x=0,y=0)
b.place(x=62,y=30)
root.mainloop()
but my problem is, Whenever i press start button, The GUI freezes and codes start getting compiled and when completed, the GUI unfreezes and the Progressbar fills itself full at once...
So i want the GUI not to freeze while processing and show correct progress on the Progressbar.
Example code and Explanation will be better for me.
Thanks for your valuable time...