Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

remove every file that ends with extension in python

import os

dir_name = "folder_path"
files = os.listdir(dir_name)

for file in files:
    if file.endswith(".png"):
        os.remove(os.path.join(dir_name, file))
 
PREVIOUS NEXT
Tagged: #remove #file #ends #extension #python
ADD COMMENT
Topic
Name
3+1 =