from matplotlib import pyplot
from matplotlib.image import imread
import os
#also try with full path:
folder = '/builtup/'
i=0
for file in os.listdir(folder):
if file.endswith('.jpg') or file.endswith('.JPG'):
if i <= 8:
pyplot.subplot(330 + 1 + i)
image = imread(os.path.join(folder,file))
pyplot.imshow(image)
i=i+1
pyplot.show()
我会做一些像。。你知道吗
使用图像的绝对路径。你知道吗
您可以迭代给定文件夹中的所有文件并检查它们是否为.jpg/.jpg
相关问题 更多 >
编程相关推荐