python remove files recursive

import shutil
shutil.rmtree('/tmp/some_folder')

remove recursive by patern:


import os
import glob

files = glob.glob('/tmp/some_folder/*db')
for f in files:
os.remove(f)

Leave a Reply

Your email address will not be published. Required fields are marked *