So I need my program to run a task every given hour of a given day, I looked for a module that could easily do it and it exists, the schedule one, unfortunately we do not have it at my company's computer and I am not allowed to install anything, so I thought of something like this as a solution
import datetime
now = datetime.datetime.now()
while True:
if now.strftime("%d") == '09':
if now.strftime("%H") == '18':
do something
but it does not quite work as expected, if i Run the program at the schedulled time it runs normally, but if it's not, it does nothing when the time comes
what can I do?
now... Your loop change runs and runs with the same value so all conditions will be the same. You need to change the value ofnowinside the loop