D
D
Daniel2019-11-16 16:13:51
Task Management
Daniel, 2019-11-16 16:13:51

How to create a task scheduler in Python?

There is input data - the task itself (what needs to be done by a period of time). There is a period of time entered through input and datetime. In the future, I want to connect graphics (most likely tkinter).
The essence of the question is (a) how can I make the data not entered from the keyboard, but selected, for example, by a roller (as on a phone).
(b) How to make it output the task at a certain time.

from datetime import date
import datetime
now = datetime.datetime.now()
plan = input("Enter you plans: ")
deadline = datetime.datetime(year=int(input('Year: ')), month=int(input('Month: ')),
                             day=int(input('Day: ')), hour=int(input('Hour: ')))
a = []
a.append(plan)
time = []
time.append(deadline)
if now <= deadline:
    print(a + time)
else:
    print("Let's start at the moment. ")

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question