Skip to content

Instantly share code, notes, and snippets.

@sgqy
Last active April 24, 2019 12:04
Show Gist options
  • Save sgqy/e27494a7864c3470125f42526b6f2a30 to your computer and use it in GitHub Desktop.
Save sgqy/e27494a7864c3470125f42526b6f2a30 to your computer and use it in GitHub Desktop.
例のポモドーロテクニックですけど
#!/usr/bin/env python3
import colorama
import time
import tqdm
def timer(minute, color):
print(colorama.Style.BRIGHT + color, end='\r')
for i in tqdm.trange(minute * 60, bar_format='{l_bar}{bar}|{n_fmt:>4s}/{total_fmt:>4s}'):
time.sleep(1)
print(colorama.Style.RESET_ALL, end='\r')
try:
while 1:
timer(25, colorama.Fore.GREEN)
timer(5, colorama.Fore.YELLOW)
except:
print(colorama.Style.RESET_ALL, end='\r')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment