Skip to content

Instantly share code, notes, and snippets.

@1ycx
Created December 11, 2021 08:04
Show Gist options
  • Save 1ycx/e28651223ae099cf2bfd779d65019d60 to your computer and use it in GitHub Desktop.
Save 1ycx/e28651223ae099cf2bfd779d65019d60 to your computer and use it in GitHub Desktop.
Download folder cleaner script
import getpass as gt
import os
from collections import Counter
WIN_BASE = "C:\\Users\\kogam\\Downloads"
EXCEL_XTS = ["xls", "xlsx", "xlsb", "xlsm", "xlam"]
SETUP_XTS = ["dmg", "deb", "dnf", "exe", "msix", "msixbundle", "cab", "cub", "ex_", "idt", "msi", "msp", "mst", "pcp", "rbf", "rra", "stf"]
ARCHIVE_XTS = ["zip", "tar", "xz", "7z", "bz2", "pkg", "lz", "lzh", "rar", "gz", "tgz", "war"]
files = os.listdir(WIN_BASE)
files_ext = [x.split(".")[-1] for x in files]
c = Counter(files_ext)
# todo
# os.walk
# https://stackoverflow.com/a/2759553/8690463
print(c)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment