Creating simple progress bar in shell / Python

Progressbar indicates if certain tasks are getting executed and when they completed.

In bash oneliner:

printf “Starting [“;for num in $(seq 50);do printf “#”;sleep 0.5;done;printf “] Successfull”

In Python:

sys.stdout.write(“Starting Operation[“)
for d in range(60):

sys.stdout.write(‘#’)
sys.stdout.flush()
time.sleep(0.50)

sys.stdout.write(“]Stoping Operation”)

These can be modified to be used anywhere in codes toprint progressbar.

Leave a Reply