Here's the main code :
```import schedule import time
def job(): print("GYM Reminder")
def job2(): print("Breakfast")
def job3(): print("Work")
def job4(): print("Party")
schedule.every(5).seconds.do(job) schedule.every().hour.do(job) schedule.every().day.at("05:00").do(job) schedule.every(5).to(10).minutes.do(job3) schedule.every().Friday.at("21:00").do(job4) schedule.every().wednesday.at("13:15").do(job) schedule.every().minute.at(":17").do(job) schedule.every(2).seconds.do(job2)
while True: schedule.run_pending() time.sleep(1)```
Manupilate it as per your liking
Bonus
*You can use this below stated code to send mails about your schedules : * import smtplib
```def sendEmail(sender_email, password, to, subject, msg): try: server = smtplib.SMTP('smtp.gmail.com', 587) server.starttls() server.login(sender_email, password)
message = f'From: {sender_email}\nTo: {to}\nSubject: {subject}\n\n{msg}'
print(message)
server.sendmail(sender_email, to, message)
server.quit()
print("Email Sent")
except:
print("Some Error Occured")
if name == 'main': SENDER_EMAIL = "youremail@xyz.com" PASSWORD = "password" TO = "yourfrnds@email.com" SUBJECT = "Reminder from Scheduler" MESSAGE = "Do your job" sendEmail(SENDER_EMAIL, PASSWORD, TO, SUBJECT, MESSAGE)```
I could have made it more neat but need to do other stuff too. If you want help in devloping something you know where to text me....
Built With
- python
- schedule
- smtplib
Log in or sign up for Devpost to join the conversation.