Create Progress Bar With Percentage Counter And Text In Python #2
Create Progress Bar With Percentage Counter And Text In Python So in this video we will talk about how to make progress bar in python with the help of cv2, also talk about the percentage counter and how to add text in the progress bar. How to Make a Progress Bar in Python #1: https://youtu.be/mUNVad51pag import cv2 import time val = 0 num = 30 '''127''' def loding(str1): copyImage = img.copy() cv2.putText(copyImage, f'{str(str1)}',(60, copyImage.shape[0]-85), cv2.FONT_HERSHEY_COMPLEX, 0.8, (255, 255, 255), 2) cv2.imshow(wndName, copyImage) def complete(str2): copyImage1 = img.copy() cv2.putText(copyImage1, f'{str(str2)}',(13, copyImage1.shape[0]-85), cv2.FONT_HERSHEY_COMPLEX, 0.8, (255, 255, 255), 2) cv2.imshow(wndName, copyImage1) img = cv2.imread(r'C:\Users\FYOPRJ\Pictures\Black2.png') cv2.rectangle(img,(30,60), (270,30), (255,255,255), 5) wndName = 'Image' for i in range(0, 25): time.sleep(0.2) num += 10 for j in range(0, 4): if i == 24: complete("Download Completed") else: loding("Downloading") cv2.rectangle(img,(30,60), (num, 30), (0,255,0), cv2.FILLED) if cv2.waitKey(1) & 0xFF == ord('q'): break time.sleep(2) cv2.destroyAllWindows() import cv2 import time val = 0 num = 30 '''127''' def printVlPars(): copyImage = img.copy() global val val += 1 cv2.putText(copyImage, f'{str(val)}%',(127, copyImage.shape[0]-135), cv2.FONT_HERSHEY_COMPLEX, 0.8, (255, 255, 255), 2) cv2.imshow(wndName, copyImage) img = cv2.imread(r'C:\Users\FYOPRJ\Pictures\Black2.png') cv2.rectangle(img,(30,60), (270,30), (255,255,255), 5) wndName = 'Image' for i in range(0, 25): time.sleep(0.2) num += 10 for j in range(0, 4): printVlPars() cv2.rectangle(img,(30,60), (num, 30), (0,255,0),cv2.FILLED) if cv2.waitKey(1) & 0xFF == ord('q'): break time.sleep(2) cv2.destroyAllWindows() #ProgressBar #PythonProgressBar #FYOPRJ
Download
0 formatsNo download links available.