Skip to content

Instantly share code, notes, and snippets.

@kareiva
Last active January 28, 2020 21:26
Show Gist options
  • Save kareiva/d5d1e5a843e49a321756 to your computer and use it in GitHub Desktop.
Save kareiva/d5d1e5a843e49a321756 to your computer and use it in GitHub Desktop.
#!/usr/bin/python
import datetime
year = 2020
def round_name(week):
return {
1: 'VHF',
2: 'UHF',
3: 'SHF',
4: 'Microwave',
}[week]
for month in range(1, 13):
for day in range(1, 29):
loop_date = datetime.datetime(year, month, day)
if loop_date.weekday() == 1:
lyacround = int((day - 1) / 7 + 1)
rounddate = loop_date.strftime('%Y-%m-%d')
print("INSERT INTO rounds VALUES('','" +
rounddate +
"','" +
round_name(lyacround) +
"'," + repr(lyacround) +
");")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment