Jun-17-2021, 12:22 AM
Well, I tried Gribouillis snipped and it works.
I have a question.
I have already a variable 'path'
I tried to use it
I'm wondering what does it mean?
Thank you!
I have a question.
I have already a variable 'path'
I tried to use it
f=pathbut the code fails.
I'm wondering what does it mean?
f=Path
from pathlib import Path import datetime as dt yesterday = dt.datetime.now().date() - dt.timedelta(days=1) dirtoscan = "c:\\0001\\" for fl in os.listdir(dirtoscan) : path = os.path.join(dirtoscan,fl) #f = path f = Path(path) if yesterday == dt.datetime.fromtimestamp(f.stat().st_mtime).date(): print(f"File was last modified yesterday - {f}")I did not try another snippet, it looks complicated, I do not understand it.
Thank you!