Suppose that your exam is knocking at the door. If you set the time in this python programme and configure perfectly then when you start your computer it remind your exam schedule through notification.
import datetime
import sys
import pynotify
now = datetime.datetime.now().replace(microsecond=0)
then = datetime.datetime(2013,07,14,10,0,0)
diff = then - now
hours = (diff.seconds) / 3600
minutes = (diff.seconds - hours * 3600) / 60
seconds = (diff.seconds - (hours * 3600 + minutes * 60))
def sendmessage(title, message):
pynotify.init("image")
notice = pynotify.Notification(title,message,"/usr/share/icons/gnome/48x48/status/important.png").show()
return notice
sendmessage("Time remaining to exam","%s days, %s hours, %s minutes and %s seconds."% (diff.days,hours,minutes,seconds))
For Linux/Ubunt, Click on preference=>Startup Application then add your python programme . After that restart your machine and after that enjoy your time notification.
0 comments