You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"""In this example, we will see how to code a progress bar for file upload using tqdm python module. Feel free to use it in your own way.
2
+
3
+
For more information, you may refer this docuentation - https://tqdm.github.io/
4
+
5
+
"""
6
+
7
+
fromtqdmimporttqdm# Importing tqdm module
8
+
fromtimeimportsleep# We are importing sleep() from time module to enter delay just for this example.
9
+
10
+
no_of_files=5# Example - 5 files to upload
11
+
12
+
""" Creating a TQDM object so that we can use it later to customize the progress bar. This line will loop through the given range i.e. number of files in this case """
13
+
14
+
obj=tqdm(range(no_of_files))
15
+
16
+
foriinobj: #iterating through object range to start the progress bar
17
+
obj.set_description(f'File uploading {i+1}:')
18
+
sleep(1) # adding manual delay. This can be skipped for real example.
0 commit comments