Skip to content

Instantly share code, notes, and snippets.

@1pha
Created April 7, 2021 01:44
Show Gist options
  • Save 1pha/376f04f6979e17d47664435aa95847b0 to your computer and use it in GitHub Desktop.
Save 1pha/376f04f6979e17d47664435aa95847b0 to your computer and use it in GitHub Desktop.
Killing desktop.ini with python function. I'm sick of deleting these .ini files through Windows explorer and made this..
import os
def kill_desktop_ini(root_dir):
for (root, dirs, files) in os.walk(root_dir):
if len(files) > 0:
for file_name in files:
if file_name.endswith('.ini'):
os.remove(f'{root}/{file_name}')
if __name__ == "__main__":
kill_desktop_ini('../../mlruns/1')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment