本地图片显示

  1. 系统自带的图片浏览器
from PIL import Image
img = Image.open('code_img.png')
img.show()
  1. matplotlib图片显示
from PIL import Image
import matplotlib.pyplot as plt
img = Image.open('code_img.png')
plt.figure('pic')
plt.imshow(img)
plt.axis('off') # 关闭坐标
plt.show()
原文地址:https://www.cnblogs.com/amize/p/15203257.html