How to delay code? I need my program to wait until first code finish and run next one step by step

16 hours ago 2
ARTICLE AD BOX

I'm going to write video editor program.

I need to write Progress Bar when program are loading as render process.

my code is
#Part 1 - Function Progress Bar called first.

def ProgessBar(): import tkinter as tk from tkinter.ttk import Progressbar global bar windowRenderLoading = tk.Tk() windowRenderLoading.title("Loading...") windowRenderLoading.geometry("430x150+720+600") bar = Progressbar(windowRenderLoading, orient="horizontal",length=350,mode='determinate').place(x=40,y=50) Render()

and
#Part 2 - Function Render called by Function Progress on last line.

def Render(): from moviepy import VideoFileClip, ImageClip ,CompositeVideoClip , TextClip clip = VideoFileClip("Test.mp4") image = ImageClip("Test Short Video Size Background Banner 4.png") final_clip = CompositeVideoClip([clip,image]) final_clip.write_videofile("Clip001.mp4", fps=clip.fps)

about Past 1 and Past 2 can run without any problem on code. But i problem about queue of part 1 and 2. "้When i run my code. windowRenderLaoding will not appear first. but my programm will render (CompositeVideoClip) until finish first. and then windowRenderLaoding will appear after that.

I need my program show windowRenderLaoding (that will show loading bar) first. before program will render video. how can i delay my part 2 code?

Read Entire Article