Last active
August 29, 2015 14:06
-
-
Save SpotlightKid/8e8647cf3e16f22f8aa0 to your computer and use it in GitHub Desktop.
Print date and time of next PyCologne meeting in German
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 python | |
# -*- coding: utf-8 -*- | |
import locale | |
from dateutil.rrule import rrule, MONTHLY, WE | |
DATE_FMT = "%A, %d. %B %Y, %H:%M Uhr" | |
locale.setlocale(locale.LC_ALL, 'de_DE.UTF-8') | |
meeting_dates = iter( | |
rrule(MONTHLY, byweekday=WE(+2), byhour=19, byminute=0, count=12)) | |
print("Nächstes PyCologne-Treffen: {}".format( | |
next(meeting_dates).strftime(DATE_FMT))) | |
print("\nNachfolgende Termine:\n") | |
for date in meeting_dates: | |
print("* {}".format(date.strftime(DATE_FMT))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment