Skip to content

Instantly share code, notes, and snippets.

@claudijd
Created January 3, 2020 16:47
Show Gist options
  • Save claudijd/dc59339bb1572360f1b574b9730c0648 to your computer and use it in GitHub Desktop.
Save claudijd/dc59339bb1572360f1b574b9730c0648 to your computer and use it in GitHub Desktop.
Clean downloads
import glob
import os
import os.path
import shutil
mydir = "/Users/jclaudius/Downloads/"
filelist = glob.glob(os.path.join(mydir, "*"))
for f in filelist:
if os.path.isdir(f):
shutil.rmtree(f)
else:
os.remove(f)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment