Created
July 17, 2019 21:26
-
-
Save kmcallister/90b1a9599b2e3a308f98e5d361330c05 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 time | |
import sys | |
repeats = 12 | |
phases = [ | |
('Inhale', 4), | |
('Hold', 2), | |
('Exhale', 6), | |
('Hold', 2) | |
] | |
print() | |
for cycle in range(repeats): | |
for name, sec in phases: | |
total_sec = sec | |
while sec > 0: | |
print("\33[2K [cycle {:2}/{:2}] \33[1;40m{:8}\33[0m[{:<{width}}]".format( | |
cycle+1, repeats, name, '=' * sec, width=total_sec), end='\r', flush=True) | |
sec -= 1 | |
time.sleep(1) | |
print("\n\nGood job! Have a relaxing day.") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment