Created
September 29, 2016 22:10
-
-
Save mikolajb/e77274678f3c371a2e65e37dd3afa9b2 to your computer and use it in GitHub Desktop.
Generate calendar of exercises to progress until 5 minute plank. (https://www.street-workouts.com/30-day-plank-challenge/)
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
""" | |
Generate calendar for 5 minute plank challenge. | |
Usage: | |
python plank.py > plank.csv | |
or | |
python plank.py NUMBER_OF_SECONDS > plank.csv | |
if you want to skip till a certain number of seconds. | |
""" | |
from datetime import date, timedelta | |
from sys import argv | |
schedule = [20, 20, 30, 30, 40, 0, 50, 50, 60, 60, 60, 80, 0, 90, 90, 110, 110, | |
110, 140, 0, 150, 150, 180, 180, 210, 220, 0, 250, 270, 300] | |
print("Subject," | |
"Start Date," | |
"All Day Event," | |
"Description") | |
start = len(argv) <= 1 | |
skip_till = 0 if start else int(argv[1]) | |
date = date.today() | |
for i in schedule: | |
if i == skip_till: | |
start = True | |
if not start: | |
continue | |
date += timedelta(days=1) | |
if i > 0: | |
print("Plank {seconds} seconds," | |
"{date}," | |
"True," | |
"Do a plank for {seconds} seconds". | |
format(seconds=i, | |
date=date.strftime("%d/%m/%Y"))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment