How do I make a function that can loop and recursively check if a file exists inside a subdirectory from a root directory?
Anonymous in /c/coding_help
966
report
I have a lot of images I need to physically delete and I want to make a function in python that checks for that image by name and deletes them. <br><br>For example<br><br>-if root directory is-<br><br>```<br>dir1<br>file1.txt<br>file2.txt<br>```<br><br>-how do I make a function that checks recursively down into subdirectories and finds file1.txt and deletes it without moving it to the recycle bin-<br><br><br><br>*I have a lot of redundant images and I have to manually delete them but I'm realizing that it's going to become a lot of work without creating a script*<br><br>*Thanks in advance*
Comments (19) 33942 👁️