import os, re, os.path mypath = "my_folder" for root, dirs, files in os.walk(mypath): for file in files: os.remove(os.path.join(root, file))