Skip to content

Instantly share code, notes, and snippets.

@se7enack
Last active February 15, 2024 20:09
Show Gist options
  • Save se7enack/d59329326dd3070fc3a521a0d03815dc to your computer and use it in GitHub Desktop.
Save se7enack/d59329326dd3070fc3a521a0d03815dc to your computer and use it in GitHub Desktop.
#!/usr/bin/env python3
import time
import curses
import os
message = "Warning - Production"
loading = True
def rotate(msg):
msg = f" {msg} "
stdscr = curses.initscr()
ani = ('\\', '|' ,'/', '-')
for i in ani:
size = os.get_terminal_size()
w = size[0]
stdscr.addstr(0, 0, "".center(w, i))
stdscr.addstr(1, 0, msg.center(w, i))
stdscr.addstr(2, 0, "".center(w, i))
stdscr.refresh()
time.sleep(.25)
while loading == True:
rotate(message)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment