import images from file python code example
Example 1: python get all images in directory
import glob
for filename in glob.iglob(root_dir + '**/*.jpg', recursive=True):
# Do something
Example 2: how to write a script to display an image in python
>>> from PIL import Image
>>> img = Image.open('test.png')
>>> img.show()