A python loading bar to use in terminal applications
Project description
Pyloading
How to install
Just use pip:
$ pip install -i https://test.pypi.org/simple/ pyloading-bar==0.1.6
How to use:
For now pyloading_bar is a very simple package to draw a simple progress bar in the terminal:
There's two versions of the bar. The Bar (most simple version of the bar):
from pyloading_bar import Bar
number_of_steps = 2
bar = bar(number_of_steps)
# do something
bar.next()
# do something
bar.next()
The usual bar is like this:
[##########]
And the RangeBar, this object is created to be used just like an interator on the for loop:
from pyloading_bar import RangeBar
for i in RangeBar(10):
print(i)
You can chage the bar by the symbol parameter:
from pyloading_bar import RangeBar
number_of_steps = 10
for step in RangeBar(number_of_steps):
print(step)
now the bar look like this:
[@@@@@@@@@@]
And if you want that the terminal don't update the last line with the new progress bar state (the progress bar assume by default that you don't print anything to the terminal), just say to the progress bar print a new line to each step:
from pyloading_bar import Bar
number_of_steps = 10
for step in RangeBar(number_of_steps, symbol='@', update_terminal=False):
print(step)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Hashes for pyloading_bar-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1dd0f48ae11baf9b4d2b01f63159187253f7a271746b366d4ef5414de40d4cb8 |
|
MD5 | f7e896dbcf7c0a4f0b5919f666310b28 |
|
BLAKE2b-256 | e0adb7db392a9a57ac638f0e58cd1b4501755517377012dd756b67be8fd4cc5b |