I want to create a folder after an hour of the current time in python. I know how to get the current time and date and to create a folder. But how to create a folder at a time specified by me. Any help would be appreciated.
from datetime import datetime
from datetime import timedelta
import os
while True:
now = datetime.now ()
#print(now.strftime("%H:%M:%S"))
y = datetime.now () + timedelta (hours = 1)
#print(y.strftime("%H:%M:%S"))
if now== y:
os.makedirs (y.strftime ("%H/%M/%S"))
will this work?
EDIT :- I have to run the code continuously i.e. creating folders at every instant of time