Text progress bar in terminal with block characters

I wrote a simple console app to upload and download files from an FTP server using the ftplib.

I would like the app to show some visualization of its download/upload progress for the user; each time a data chunk is downloaded, I would like it to provide a progress update, even if it’s just a numeric representation like a percentage.

Importantly, I want to avoid erasing all the text that’s been printed to the console in previous lines (i.e. I don’t want to “clear” the entire terminal while printing the updated progress).

This seems a fairly common task – how can I go about making a progress bar or similar visualization that outputs to my console while preserving prior program output?

Leave a Comment