I have my process working with Tkinter, but when I run my code my program freeze I understandt It´s because of the main loop, I have been reading the documentation of Tkinter and reading some other questions but I can´t really understand how to implement the Progress Bar to my process, my code It´s really simple it just dowload some information and then save It like an excel but It takes some time to do the process, so how can I implement the progress bar here.
root=Tk()
root.title('Info Dowload')
root.iconbitmap('Logo.ico')
root['bg'] = '#E1FAF9'
#VariablesInicio
fecha1=Entry(root)
fecha2=Entry(root)
date1.insert(0, "ejm:2022-03-15")
date2.insert(0, "ejm:2022-03-15")
#Label
label1=Label(root,text="First Date(aaaa-mm-dd):",font=('Bahnschrift',11))
label2=Label(root,text="Second date(aaaa-mm-dd):",font=('Bahnschrift',11))
def Click():
boton1.config(state= "disable")
label3=Label(root,text="Working with: "+date1.get())
label4=Label(root,text="Working with: "+date2.get())
label3.grid(row=3,column=0)
label4.grid(row=4,column=0)
startFac=str(date1.get())+' 00:00:00'
endFac=str(date2.get())+' 23:59:59'
##First Query
startMF=str(date1.get())
endMF=str(date2.get())
startMF=startMF.replace('-','/')
endMF=endMF.replace('-','/')
df=query1(startMF, endMF)
df1=query2(startFac, endFac, df)
sales=pd.merge(left=df,right=df1,how='left',on=['code1','code2','code3'])
sales.to_excel('sales.xlsx',index=None)
#Button
import tkinter as tk
boton1=tk.Button(root,text='Ejecutar',bg='#20bebe',fg='white',height=1,width=6,command=Click)
#Print info
label1.grid(row=0,column=0)
label2.grid(row=1,column=0)
fecha1.grid(row=0,column=1)
fecha2.grid(row=1,column=1)
boton1.grid(row=2,column=0)
root.mainloop()