I have a function which simply encrypts files inside a directory
def encrypt_directory(location):
os.chdir(location)
for file in glob.glob("*.*"):
encrypt_file(file)
print(file + " is encrypted")
My question is: How can i access to subdirectories of location
and apply encrypt_file
function to files inside them?