Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

9 Commits

Repository files navigation

this source-code is under Apache License 2.0 , read LICENSE for more information

Loading

easy loading bar !

loading is a way to do loading bar in python

  • fully customizable
  • easy to use

how to use :

bar=Bar(100)
foriinrange(1000):
bar.update(message=i)

example :

loading=Bar(100,lenght=50,time=True)
foryeetinrange(100):
ifloading.update(message=yeet,time=(100-yeet) ):
time.sleep(1)
else:
break

explication :

when you init the Bar , the first args is the number of iterations so if you do Bar(1000) you have to do 1000 iteration for finish the bar

for make the bar iterate , use .update

classutilityrequired argumentreturn
Barinit the bartotal (number of iteration)Bar instance
fonctionutilityrequired argumentreturn
updateiterate the BarNonebool

kwarg :

for Bar

kwargutilitydefault argument
lenghtthe lenght of the bar100
timeif you want to show a timerFalse
progressthe progresse of the bar0
start_charthe first char of the bar"["
start_middle_charthe middle char"="
white_charthe whitespace char" " (a whitespace)
end_middle_charusualy the cursor">"
end_charthe last char"]"

for update

kwargutilitydefault argument
messagelike the advancement of the loading (or like log)None
timeyou have to active time setting when init the bar define the remaning time0 (give it in second)

Installation

download bar.py and import it in your project (check that it is in the right path) ex :

from bar import Bar

tested on :

  • windows 10
  • debian 9
  • ubuntu 18.04

with python 3.9.2

todo :

  • fully customizable
  • crusade the bugs
  • more things ?
  • drinking a coffee
  • eat
  • sleep

About

an easy and fully customizable way to do loading bar in cli

Resources

Stars

3 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages