Nov-27-2018, 11:33 PM
I just want to get a list of images in a directory trying this
Thanks for looking
from PIL import Image import os, os.path imgs = [] path = "C:\Users\me\pictures" valid_images = [".jpg",".gif",".png",".tga"] for f in os.listdir(path): ext = os.path.splitext(f)[1] if ext.lower() not in valid_images: continue imgs.append(Image.open(os.path.join(path,f))) print (imgs)but getting this error
path = "C:\Users\me\pictures\" ^ SyntaxError: EOL while scanning string literalLooked at articles on the net but the more I read the more confusing it becomes?
Thanks for looking