【发布时间】:2019-01-13 17:16:25
【问题描述】:
#!/usr/bin/python
from os import listdir
from PIL import Image as PImage
def loadImages(path):
# return array of images
imagesList = listdir(path)
loadedImages = []
for image in imagesList:
img = PImage.open(path + image)
loadedImages.append(img)
return loadedImages
path = r"C:\Users\Aidan\Desktop\APDR_PDhh_epi5new.bmp"
# your images in an array
imgs = loadImages(path)
for img in imgs:
# you can show every image
img.show()
NotADirectoryError: [WinError 267] 目录名无效: 'C:\Users\Aidan\Desktop\APDR_PDhh_epi5new.bmp'
上面是错误。
我的桌面上有名为“APDR_PDhh_epi5new.bmp”的位图文件,但出现错误。我做错了什么?
【问题讨论】:
标签: python image desktop reader