Aug-06-2021, 11:06 PM
Modify your code above to become a function. Have the function take the name of the file and operate on it.
Then use glob.glob or Path.iterdir() (or os.scandir) to get all the files in a directory that you want. Loop over them and pass the filenames or filepaths to your function.
Then use glob.glob or Path.iterdir() (or os.scandir) to get all the files in a directory that you want. Loop over them and pass the filenames or filepaths to your function.