just reminder using python ToastNotifier
import schedule
import calendar
import time
import os
from win10toast import ToastNotifier
from datetime import datetime
from datetime import date
def job_test():
print("job2: Train time ..."+datetime.now().strftime('%H:%M'))
toaster = ToastNotifier()
toaster.show_toast(title="Test",msg="Test time"+datetime.now().strftime('%H:%M'))
def job():
print("I'm working job...", "Hello "+datetime.now().strftime('%H:%M'))
#os.system("Cricket_score.py")
#toaster = ToastNotifier()
#toaster.show_toast(title="Time alert",msg="Hello "+datetime.now().strftime('%H:%M'))
today = date.today()
last_day = last_day_of_month(today.year, today.month)
if today == last_day:
print("billpayment ...", datetime.now().strftime('%H:%M'))
toaster = ToastNotifier()
toaster.show_toast(title="Last day for Bill Payment ",msg="Last day for Bill Payment \n "+datetime.now().strftime('%H:%M'))
def job1():
print("job1: Lunch time..."+datetime.now().strftime('%H:%M'))
toaster = ToastNotifier()
toaster.show_toast(title="Lunch time",msg="Lunch time"+datetime.now().strftime('%H:%M'))
def job2():
print("job2: Train time ..."+datetime.now().strftime('%H:%M'))
toaster = ToastNotifier()
toaster.show_toast(title="Train time",msg="Train time"+datetime.now().strftime('%H:%M'))
def job4():
print("job4: Time alert with Cricket_score...", datetime.now().strftime('%H:%M'))
#os.system("Cricket_score.py")
def social():
print("social: Social time...", datetime.now().strftime('%H:%M'))
toaster = ToastNotifier()
toaster.show_toast(title="Social time ",msg="Social time "+datetime.now().strftime('%H:%M'))
def billpayment():
today = date.today()
print "today", today
last_day = last_day_of_month(today.year, today.month)
print last_day
if today == last_day:
print("billpayment ...", datetime.now().strftime('%H:%M'))
toaster = ToastNotifier()
toaster.show_toast(title="Last day for Bill Payment ",msg=" Last day for Bill Payment \n "+datetime.now().strftime('%H:%M'))
def last_day_of_month(year, month):
""" Work out the last day of the month """
last_days = [31, 30, 29, 28, 27]
for i in last_days:
try:
end = datetime(year, month, i)
except ValueError:
continue
else:
return end.date()
return None
def tutkal_booking():
print("tutkal_booking: Time alert for Tutkal Ticket booking...", datetime.now().strftime('%H:%M'))
toaster = ToastNotifier()
toaster.show_toast(title="Tutkal Ticket booking ",msg="Tutkal Ticket booking "+datetime.now().strftime('%H:%M'))
print "Started working toaster "+datetime.now().strftime('%H:%M')
print ("*"*20)
toaster = ToastNotifier()
toaster.show_toast(title="Welcome ",msg="Hello Kannan \n "+datetime.now().strftime('%H:%M'), duration=20)
#while toaster.notification_active(): time.sleep(0.1)
today = date.today()
#print "today", today
#today = date(2018, 4, 30)
#print "today", today
#print "today", today.day
last_day = last_day_of_month(today.year, today.month)
#print "last_day", last_day
#print "test", today == last_day
if today == last_day:
print("billpayment ...", datetime.now().strftime('%H:%M'))
toaster.show_toast(title="Bill payment reminder ",msg="Today is the last day \n Don't miss to pay your bill \n "+datetime.now().strftime('%H:%M'))
schedule.every(5).minutes.do(job_test)
schedule.every().hour.do(job4)
schedule.every().day.at("9:00").do(billpayment)
schedule.every().day.at("10:00").do(billpayment)
schedule.every().day.at("10:55").do(tutkal_booking)
schedule.every().day.at("17:55").do(job2)
schedule.every().day.at("17:50").do(job)
schedule.every().day.at("13:00").do(job1)
schedule.every().friday.at("15:00").do(social)
#schedule.every(5).to(10).days.do(job)
#schedule.every().monday.do(job)
#schedule.every().wednesday.at("13:15").do(job)
while True:
schedule.run_pending()
time.sleep(1)
import calendar
import time
import os
from win10toast import ToastNotifier
from datetime import datetime
from datetime import date
def job_test():
print("job2: Train time ..."+datetime.now().strftime('%H:%M'))
toaster = ToastNotifier()
toaster.show_toast(title="Test",msg="Test time"+datetime.now().strftime('%H:%M'))
def job():
print("I'm working job...", "Hello "+datetime.now().strftime('%H:%M'))
#os.system("Cricket_score.py")
#toaster = ToastNotifier()
#toaster.show_toast(title="Time alert",msg="Hello "+datetime.now().strftime('%H:%M'))
today = date.today()
last_day = last_day_of_month(today.year, today.month)
if today == last_day:
print("billpayment ...", datetime.now().strftime('%H:%M'))
toaster = ToastNotifier()
toaster.show_toast(title="Last day for Bill Payment ",msg="Last day for Bill Payment \n "+datetime.now().strftime('%H:%M'))
def job1():
print("job1: Lunch time..."+datetime.now().strftime('%H:%M'))
toaster = ToastNotifier()
toaster.show_toast(title="Lunch time",msg="Lunch time"+datetime.now().strftime('%H:%M'))
def job2():
print("job2: Train time ..."+datetime.now().strftime('%H:%M'))
toaster = ToastNotifier()
toaster.show_toast(title="Train time",msg="Train time"+datetime.now().strftime('%H:%M'))
def job4():
print("job4: Time alert with Cricket_score...", datetime.now().strftime('%H:%M'))
#os.system("Cricket_score.py")
def social():
print("social: Social time...", datetime.now().strftime('%H:%M'))
toaster = ToastNotifier()
toaster.show_toast(title="Social time ",msg="Social time "+datetime.now().strftime('%H:%M'))
def billpayment():
today = date.today()
print "today", today
last_day = last_day_of_month(today.year, today.month)
print last_day
if today == last_day:
print("billpayment ...", datetime.now().strftime('%H:%M'))
toaster = ToastNotifier()
toaster.show_toast(title="Last day for Bill Payment ",msg=" Last day for Bill Payment \n "+datetime.now().strftime('%H:%M'))
def last_day_of_month(year, month):
""" Work out the last day of the month """
last_days = [31, 30, 29, 28, 27]
for i in last_days:
try:
end = datetime(year, month, i)
except ValueError:
continue
else:
return end.date()
return None
def tutkal_booking():
print("tutkal_booking: Time alert for Tutkal Ticket booking...", datetime.now().strftime('%H:%M'))
toaster = ToastNotifier()
toaster.show_toast(title="Tutkal Ticket booking ",msg="Tutkal Ticket booking "+datetime.now().strftime('%H:%M'))
print "Started working toaster "+datetime.now().strftime('%H:%M')
print ("*"*20)
toaster = ToastNotifier()
toaster.show_toast(title="Welcome ",msg="Hello Kannan \n "+datetime.now().strftime('%H:%M'), duration=20)
#while toaster.notification_active(): time.sleep(0.1)
today = date.today()
#print "today", today
#today = date(2018, 4, 30)
#print "today", today
#print "today", today.day
last_day = last_day_of_month(today.year, today.month)
#print "last_day", last_day
#print "test", today == last_day
if today == last_day:
print("billpayment ...", datetime.now().strftime('%H:%M'))
toaster.show_toast(title="Bill payment reminder ",msg="Today is the last day \n Don't miss to pay your bill \n "+datetime.now().strftime('%H:%M'))
schedule.every(5).minutes.do(job_test)
schedule.every().hour.do(job4)
schedule.every().day.at("9:00").do(billpayment)
schedule.every().day.at("10:00").do(billpayment)
schedule.every().day.at("10:55").do(tutkal_booking)
schedule.every().day.at("17:55").do(job2)
schedule.every().day.at("17:50").do(job)
schedule.every().day.at("13:00").do(job1)
schedule.every().friday.at("15:00").do(social)
#schedule.every(5).to(10).days.do(job)
#schedule.every().monday.do(job)
#schedule.every().wednesday.at("13:15").do(job)
while True:
schedule.run_pending()
time.sleep(1)
Comments
Post a Comment