#57 Progress Bar

A progress bar is a visual element that shows how much of a task has been completed. Progress bars are often used alongside downloading files or software installations. This project creates a getProgressBar() function that returns a progress bar string based on the arguments passed to it. It simulates a downloading file, but you can reuse the progress bar code in your own projects.

The Program in Action

When you run progressbar.py, the output will look like this:

Progress Bar Simulation, by Al Sweigart
[█████████                               ] 24.6% 1007/4098

How It Works

The progress bar relies on a certain trick that programs running in terminal windows ...

Get The Big Book of Small Python Projects now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.