Last active
April 24, 2019 12:04
-
-
Save sgqy/e27494a7864c3470125f42526b6f2a30 to your computer and use it in GitHub Desktop.
例のポモドーロテクニックですけど
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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