Delete all file in a directory using python
files_path=os.path.join(settings.MEDIA_ROOT , 'intermediate',str(request.user))
for root, dirs, files in os.walk(files_path):
for filename in files:
os.remove(os.path.join(root, filename))
Comments
Post a Comment