Skip to content

Instantly share code, notes, and snippets.

@mikolajb
Created September 29, 2016 22:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mikolajb/e77274678f3c371a2e65e37dd3afa9b2 to your computer and use it in GitHub Desktop.
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/)
"""
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