Skip to content

Commit

Permalink
a simple timer
Browse files Browse the repository at this point in the history
Signed-off-by: MisileLab <[email protected]>
  • Loading branch information
MisileLab committed Nov 27, 2023
1 parent 498fa28 commit 03610a8
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions projects/utils/the-simple-timer.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
from shutil import get_terminal_size
from time import strftime, sleep


def print_line_vcentred(s):
centre_line = int(get_terminal_size().lines / 2)
print('\n' * centre_line, s.center(get_terminal_size().columns),
'\n' * centre_line)


while True:
print_line_vcentred(strftime('%H:%M:%S'))
sleep(1)

0 comments on commit 03610a8

Please sign in to comment.