I'm pretty new to python in general.
Im currently having some issue with the os package in python. This code works if i run it trought the terminal on my mac, but gives an error when ran on the raspberry pi 3 where i get a `FileNotFoundError: [Errror 2] No such file or directory: '../images/' [Error].
Code: Select all
def getImages(): currentPath = os.path.dirname(os.path.abspath(__file__)); # Absolute dir the script is in filepath = "../images/"; # The path where the pictures are uploaded directory = os.listdir(os.path.join(currentPath, filepath)); images = [ fi for fi in directory if fi.endswith(('.JPG', '.jpg', 'jpeg', '.JPEG')) ]; return images;
If needed, the whole code can be watched here:
https://github.com/smajohusic/work-in-p ... ize.py#L18