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
Alternate approach that avoids join-ing yourself over and over: Use glob module to join once, then let it give you back the paths directly.
glob
import glob import os dir = "/Users/ben/downloads/" for zippath in glob.iglob(os.path.join(dir, '*.zip')): os.remove(zippath)