Skip to content

Instantly share code, notes, and snippets.

@SpotlightKid
Last active August 29, 2015 14:06
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 SpotlightKid/8e8647cf3e16f22f8aa0 to your computer and use it in GitHub Desktop.
Save SpotlightKid/8e8647cf3e16f22f8aa0 to your computer and use it in GitHub Desktop.
Print date and time of next PyCologne meeting in German
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#!/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