Skip to content

Instantly share code, notes, and snippets.

@partrita
Last active November 29, 2019 13:47
Show Gist options
  • Save partrita/2f2f7c794fff73a4a004a926ca94ded0 to your computer and use it in GitHub Desktop.
Save partrita/2f2f7c794fff73a4a004a926ca94ded0 to your computer and use it in GitHub Desktop.
simple pomodoro timer for me
import sys
import time
import argparse
from tqdm import tqdm
parser = argparse.ArgumentParser(description='Set time of timer. It shoud be minute')
parser.add_argument('-t', '--time', type=int, default=25, help='Set pomodoro interval.')
parser.add_argument('-b', '--break_time', type=int, default=5, help='Set pomodoro interval.')
parser.add_argument('-r', '--repeat', type=int, default=3, help='Set round of pomodoro.')
args = parser.parse_args()
time_pomo = args.time*60 # default 25 min
time_break = args.break_time*60 # default 5 min
rep_pomo = args.repeat
if __name__=="__main__":
count = 1
while rep_pomo > 0:
print(f'This is Pomodoro {count}, May the focus be with you.')
for i in tqdm(range(time_pomo)):
time.sleep(1)
print('Take 5min break')
for i in tqdm(range(time_break)):
time.sleep(1)
count -= -1
rep_pomo -= +1
print(f'Pomodoro timer is over')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment