from tkinter import *
from tkinter.ttk import Progressbar
root = Tk()
root.geometry("480x320")
winwidth = root.winfo_reqwidth()
#size = 5
def func(*args):
global progressbar
#size = 0
progressbar['value'] += 3
root.after(100, func)
global progressbar
progressbar = Progressbar(orient=HORIZONTAL, length=winwidth)
progressbar.pack()
func()
mainloop()