Skip to content

Instantly share code, notes, and snippets.

@danielskowronski
Created March 3, 2016 14:09
Show Gist options
  • Save danielskowronski/ff476992453d071a399a to your computer and use it in GitHub Desktop.
Save danielskowronski/ff476992453d071a399a to your computer and use it in GitHub Desktop.
timer.sh na SFI
# CZASOMIERZ
import time
import sys
t = int(sys.argv[1])
from subprocess import call
call(["clear", ""])
while t:
mins, secs = divmod(t, 60)
timeformat = '{:02d}:{:02d}'.format(mins, secs)
print(" "+timeformat, end="\r")
time.sleep(1)
t -= 1
while True:
mins, secs = divmod(t, 60)
timeformat = '{:02d}:{:02d}'.format(mins, secs)
print(" \033[41m-"+timeformat, end="\033[49m !\r")
time.sleep(1)
t += 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment