December 2018
Intermediate to advanced
268 pages
8h 23m
English
#!/usr/bin/env python3from PIL import Imageimport numpy as npimport os
def grabListOfFiles(startingDirectory,extension=".webp"): listOfFiles = [] for file in os.listdir(startingDirectory): if file.endswith(extension): listOfFiles.append(os.path.join(startingDirectory, file)) return listOfFiles
The great thing about the preceding function is that it will recursively search the directory and find every file with the given extension. In our case, ...
Read now
Unlock full access