-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtask3.py
33 lines (24 loc) · 919 Bytes
/
task3.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import schedule
import time
import datetime
def Task_Second():
print("Task based on seconds gets Schedculed at : ",datetime.datetime.now())
def Task_Minute():
print("Task based on Minutes gets Schedculed at : ",datetime.datetime.now())
def Task_Hour():
print("Task based on Hour gets schedculed at : ",datetime.datetime.now())
def Task_Day():
print("Task based on Day gets schedculed at : ",datetime.datetime.now())
def main():
print("Inside task Schedular")
print("Current time is : ",datetime.datetime.now())
#HERE SCHEDULING OF TIME OF TASK IS SCHEDULED
schedule.every(1).second.do(Task_Second)
schedule.every(1).minute.do(Task_Minute)
schedule.every(1).hour.do(Task_Hour)
schedule.every().saturday.at("18:00").do(Task_Day)
while(True):
schedule.run_pending()
time.sleep(1)
if __name__ == '__main__':
main()