- 博客(2)
- 收藏
- 关注
原创 Python用PIL打开显示图片
from PIL import Image #打印图片路径及名称 image_path = os.path.join(root,file) print(image_path) #显示图片 img=Image.open(image_path) plt.imshow(img)plt.axis('off') plt.show()
2017-09-26 13:59:00
7831
原创 python使用os.walk和os.path.join来遍历文件夹的文件(包括子文件夹下的文件)
python使用os.walk和os.path.join来遍历文件夹的文件(包括子文件夹下的文件) import os import os.path path = 'C://' for root, dirs, files in os.walk(path): for file in files: print os.path.join(root, file)
2017-09-26 13:53:52
1993
1
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人