Run a python script in the future

Viewed 1308

I have got a python script which needs to be run on the user inputs. I will get the date and time from user and the script will run at that date.

import time
from datetime import datetime

today = datetime.today() 
enter_date = raw_input("Please enter a date:(2017-11-28): ")
enter_time = raw_input("What time do you want to start the script? ")

difference = enter_date - today

time.sleep(difference)

After this point main() function will run.

I could not make it run. Is there any better way to achieve this task ? Thanks

3 Answers
Related