First off, let me apologize if the title is unclear.
To simplify a task I do at work, I've started writing this script to automate the removal of files from a certain path.
My issue is that in its current state, this script does not check the contents of the folders within the folder provided by the path.
I'm not sure how to fix this, because from what I can tell, it should be checking those files?
import os
def depdelete(path):
for f in os.listdir(path):
if f.endswith('.exe'):
os.remove(os.path.join(path, f))
print('Dep Files have been deleted.')
else:
print('No Dep Files Present.')
def DepInput():
print('Hello, Welcome to DepDelete!')
print('What is the path?')
path = input()
depdelete(path)
DepInput()