5 ms·
Woof. That is one python program I would not call "executable pseudocode."
by monochromatic 11y ago
Woof. That is one python program I would not call "executable pseudocode."
- zokier 11y agoMore idiomatic version is more readable but also more verbose: cutoff_date = datetime.now() - timedelta(days=7) for basepath,_,files in os.walk('/tmp'): for filename in files: filepath = os.path.join(basepath, filename) if datetime.fromtimestamp(os.stat(filepath).st_mtime) < cutoff_date: os.unlink(filepath) Python is not really that great when forced to oneliner format, and I'm not really a good code golfer anyways.