Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os
- import time
- current_time = time.time()
- for f in os.listdir():
- file_creation_time = os.path.getctime(f)
- if (current_time - file_creation_time) // (24 * 3600) >= 3:
- os.unlink(f)
- print('{} removed'.format(f))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement