I am trying to have an automated script that enters into the most recently created folder.
I have some code below
import datetime, os, shutil
today = datetime.datetime.now().isoformat()
file_time = datetime.datetime.fromtimestamp(os.path.getmtime('/folders*'))
if file_time < today:
changedirectory('/folders*')
I am not sure how to get this to check the latest timestamp from now. Any ideas?
Thanks