Nov-26-2018, 01:30 PM
Trying this
Any help welcome.
from PIL import Image import os, os.path imgs = [] path = "c/users/anybloodyid/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)keep getting this
print (imgs) ^ SyntaxError: invalid syntaxAll I want to do is place some png images in an array so I can then later pick them at random
Any help welcome.