Compare commits
2 Commits
8a54cedb5b
...
5fad6f294c
Author | SHA1 | Date |
---|---|---|
|
5fad6f294c | |
|
9a771e8cd4 |
|
@ -1,5 +1,7 @@
|
||||||
# Python
|
# Python
|
||||||
__pycache__
|
__pycache__
|
||||||
|
Pipfile
|
||||||
|
Pipfile.lock
|
||||||
|
|
||||||
# CAD
|
# CAD
|
||||||
*.stl
|
*.stl
|
||||||
|
|
|
@ -0,0 +1,33 @@
|
||||||
|
# Draw text to center of screen
|
||||||
|
import curses
|
||||||
|
|
||||||
|
screen = curses.initscr()
|
||||||
|
num_rows, num_cols = screen.getmaxyx()
|
||||||
|
|
||||||
|
|
||||||
|
# Make a function to print a line in the center of screen
|
||||||
|
def print_center(message):
|
||||||
|
# Calculate center row
|
||||||
|
middle_row = int(num_rows / 2)
|
||||||
|
|
||||||
|
# Calculate center column, and then adjust starting position based
|
||||||
|
# on the length of the message
|
||||||
|
half_length_of_message = int(len(message) / 2)
|
||||||
|
middle_column = int(num_cols / 2)
|
||||||
|
x_position = middle_column - half_length_of_message
|
||||||
|
|
||||||
|
# Draw the text
|
||||||
|
screen.addstr(middle_row, x_position, message)
|
||||||
|
screen.refresh()
|
||||||
|
|
||||||
|
|
||||||
|
print_center("Greatness awaits...")
|
||||||
|
|
||||||
|
# Wait and cleanup
|
||||||
|
while True:
|
||||||
|
try:
|
||||||
|
curses.napms(500)
|
||||||
|
except KeyboardInterrupt:
|
||||||
|
break
|
||||||
|
|
||||||
|
curses.endwin()
|
|
@ -0,0 +1,5 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
pipenv install -r requirements.txt
|
||||||
|
|
||||||
|
pipenv run python dash.py
|
Loading…
Reference in New Issue