Skip to content

Instantly share code, notes, and snippets.

@mujeebishaque
Created December 3, 2019 18:30
Show Gist options
  • Save mujeebishaque/c500aca5bbc93a60f1f1a3f68e201c50 to your computer and use it in GitHub Desktop.
Save mujeebishaque/c500aca5bbc93a60f1f1a3f68e201c50 to your computer and use it in GitHub Desktop.
delete all the .xml files from your images dataset including folders, subfolders
import os
for root, dirs, files in os.walk(os.getcwd()):
for _dir in dirs:
current_dir = os.getcwd() + os.sep + _dir
for x in os.listdir(current_dir):
if x.endswith(".xml"):
# print(current_dir + os.sep + x)
os.remove(current_dir + os.sep + x)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment