Discuss / Python / 图片是怎么读的,是自带的还是可以读自己想用的,大透明一点都不懂

图片是怎么读的,是自带的还是可以读自己想用的,大透明一点都不懂

Topic source

im = Image.open('lena.png') Traceback (most recent call last): File "<pyshell#6>", line 1, in <module> im = Image.open('lena.png') File "C:\Program Files\Python35\lib\site-packages\PIL\Image.py", line 2282, in open fp = builtins.open(filename, "rb") FileNotFoundError: [Errno 2] No such file or directory: 'lena.png'

读取和代码处于同一目录下的 lena.png

可以自己写路径,例:c:\work\source\lena.png


  • 1

Reply