2022-06-11 20:06:30 +02:00
|
|
|
#!/usr/bin/python3
|
|
|
|
|
|
|
|
import curses
|
|
|
|
import time
|
|
|
|
|
|
|
|
curses.initscr()
|
|
|
|
|
2022-06-11 21:06:59 +02:00
|
|
|
|
2022-06-11 20:06:30 +02:00
|
|
|
def initBar():
|
|
|
|
global progress_win
|
|
|
|
progress_win = curses.newwin(3, 62, 3, 10)
|
|
|
|
progress_win.border(0)
|
|
|
|
|
2022-06-11 21:06:59 +02:00
|
|
|
|
2022-06-11 20:06:30 +02:00
|
|
|
def updateBar(progress):
|
|
|
|
global progress_win
|
2022-06-12 00:26:34 +02:00
|
|
|
pos = (60 * progress) // 100
|
|
|
|
if pos != 0 :
|
2022-06-12 12:50:04 +02:00
|
|
|
progress_win.addstr(1, 1, "#" * pos)
|
2022-06-11 20:06:30 +02:00
|
|
|
progress_win.refresh()
|
|
|
|
|
2022-06-11 21:06:59 +02:00
|
|
|
|
2022-06-11 20:06:30 +02:00
|
|
|
initBar()
|
|
|
|
loading = 0
|
2022-06-12 12:50:04 +02:00
|
|
|
while loading <= 100:
|
2022-06-11 20:06:30 +02:00
|
|
|
time.sleep(0.03)
|
|
|
|
updateBar(loading)
|
2022-06-12 12:50:04 +02:00
|
|
|
loading += 3
|
2022-06-11 20:06:30 +02:00
|
|
|
|
|
|
|
time.sleep(1)
|
|
|
|
|
2022-06-12 00:26:34 +02:00
|
|
|
#curses.endwin()
|
2022-06-11 20:06:30 +02:00
|
|
|
curses.flushinp()
|