I\'m trying to write a python script to delete all files in a folder older than X days. This is what I have so far:
import os, time, sys path = r\"c:\\user
You need to give it the path also or it will look in cwd.. which ironically enough you did on the os.remove but no where else...
os.remove
for f in os.listdir(path): if os.stat(os.path.join(path,f)).st_mtime < now - 7 * 86400: