delete files with same extensions

Solutions on MaxInterview for delete files with same extensions by the best coders in the world

showing results for - "delete files with same extensions"
Giada
23 Nov 2020
1import os
2
3dir_name = "/Users/ben/downloads/"
4test = os.listdir(dir_name)
5
6for item in test:
7    if item.endswith(".zip"):
8        os.remove(os.path.join(dir_name, item))
9
queries leading to this page
python delete file without extensionpython how to dlt a certain file typeremove extension of file pythonhow to remove extension from a filename in pythonremove extension from filename pythonpyhton remove file extensionhow to delete all files with specific extensiondelete file that ends with pythonpython remove file with extensionpython remove files with extensionhow to delete all file with extension pythondelete file irrespective of extension pythonremove file extension from filename pythonremove file extension pythonpython delete file with a certain extensionremove extension from a filename pythonremove from extension from text file pythonhow to remove file extension in pythonhow to remove all files with extension in pythonshutil delete all files in extension opython delete all file with extensionerase extension of file pythonhow to remove extension from filename in pythonhow to delete certian type files in a folder pythonhow to make a python file that deletes one extension onlypython remove extension from filenamepython remove file extension from stringhow to make a python code that deletes a specific extension file in a directorypython delete all files with extensionremove extension file pythonremove extension filename pythondelete all files with specific extension pythonpython remove specific format fileremoving file extension in pythonhow to remove the extension of a file in pythonpython remove the file extensionsearch through folder and delete anything with a certain extension pythonremove file without extension pythonpython remove all folders with extentionhow to disclode file type pythonpython os remove all files with extensionrecover file extension after deleting it pythonhow to remove the extension from a file name pythonhow to remove file extension from filename pythonremoving extension from filename pythonpython delete files with extensionpython code to remove the extension from the filepython delete files with specific extensionpython remove file extension from filename stringpython remove file extension from filenamepython delete a specific file extensionremove file extension in pythonpython delete all files in directory with extensiondelete all txt files in directory pythonpython script to delete files with extensionhow remove extension from file pythonpython remove file extensionpython remove all files with extensionpython delete file with extensionremove files with extension pythonhow to remove file extension pytohnpython file remove extensionremove file extension python stringget rid of all files ending with extension pyremove file extension from string pythonhow to delete files by type pythonremove extension pythonremoving file extension from files in pythondelete files with same extensions