Skip to content

Instantly share code, notes, and snippets.

@tzwel
Created June 12, 2022 18:49
Show Gist options
  • Save tzwel/bdf51944cd1ca2bcd74e71fbeb6758d2 to your computer and use it in GitHub Desktop.
Save tzwel/bdf51944cd1ca2bcd74e71fbeb6758d2 to your computer and use it in GitHub Desktop.
import os
extensionsToDelete = [".zip", ".rar"]
files = os.listdir()
for file in files:
split_tup = os.path.splitext(file)
if split_tup[1] in extensionsToDelete:
print(file)
choice = input("delete? [y/n]")
if choice == "y":
os.remove(file)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment