I was messing around just trying to make a script that deletes items by \".zip\" extension.
import sys import os from os import listdir test=os.listdir(\"/U
You can set the path in to a dir_name variable, then use os.path.join for your os.remove.
dir_name
os.path.join
os.remove
import os dir_name = "/Users/ben/downloads/" test = os.listdir(dir_name) for item in test: if item.endswith(".zip"): os.remove(os.path.join(dir_name, item))