loading...
Cover image for Write a responsive progressbar for the commandline using Python.

Write a responsive progressbar for the commandline using Python.

deepjyoti30 profile image Deepjyoti Barman Originally published at deepjyoti30.github.io ・1 min read

We have all seen progressbars everywhere. We see them on websites all the time and those of us who use a Linux distro, looking at a progressbar is like one of our day to day tasks. Especially when you use the terminal like you can nuke a country from it. Progressbars are used by a lot of commandline software's we use. Python's pip use them, npm has an awesome progressbar along with a spinner and our holy pacman, obviously has one too.

However, progressbars are sometimes messy. If you've used pip more than just a couple of times, it is unavoidable to notice that the progressbar's size is predefined. What that means is, the bar doesn't resize depending on the width of the terminal, messing up the output a lot of times.

Alt Text

Though, pip's bar might not be responsive, pacman has a really neat bar that hardly screw's up. The length of the bar changes according to the width of the terminal.

So how can we make a responsive, awesome progressbar ourselves? Read ahead and you'll know.

Read the rest of the article here

Posted on by:

deepjyoti30 profile

Deepjyoti Barman

@deepjyoti30

Web Developer. Python. Linux. Love Operating Systems.

Discussion

markdown guide