I'm creating an event notification system for our gaming community. However, I'm not entirely sure where to start.
I have a dictionary of events and their times, for example:
{'Game Night': 19:00 2013-06-29,
'3CB vs ST3 Match': 18:45 2013-07-02,
'Website Maintainance': 13:00 2013-07-16,
etc}
The times have already been converted to the correct datetime format using strptime(). What I now need is for the user to be notified when one of these events is about to occur (e.g a 15 minute alert, then a 5 minute alert).
For example:
"NOTICE: 3CB vs ST3 Match will begin in 15 minutes!" 10 minutes later... "NOTICE: 3CB vs ST3 Match will begin in 5 minutes!"
My question is this: How can I get python to wait until an event is near (by comparing the current time, with the event's time), then perform an action (e.g. a notification in my case)?
P.S I'm using Python 2.7.5 (due to lack of API updates)