Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
bigbuny authored Feb 20, 2024
1 parent f6968bf commit 156e52d
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions animation_.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import curses
import time

def loading_animation(win):
curses.curs_set(0) # Hide the cursor
win.clear()

height, width = win.getmaxyx()
x = width // 2 - 6
y = height // 2

for i in range(1, 101):
progress_bar = "[" + "=" * (i // 2) + ">" + " " * ((100 - i) // 2) + "]"
win.addstr(y, x, f"Loading... {progress_bar} {i}%", curses.A_BOLD)
win.refresh()
time.sleep(0.1)

win.addstr(height - 1, 0, "Loading complete!", curses.A_BOLD)
win.refresh()
time.sleep(2)

def main(stdscr):
loading_animation(stdscr)

if __name__ == "__main__":
curses.wrapper(main)

0 comments on commit 156e52d

Please sign in to comment.