为什么我照着论坛上图片处理的代码抄的运行的结果还是有错然后啥也没有
这个是怎么回事,想问问 发文本代码及文本错误信息 库有了吗 Gacy 发表于 2022-3-30 13:15库有了吗
库我安装的呢,我直接将论坛上的代码复制粘贴过来的可是不行{:5_105:} wp231957 发表于 2022-3-30 12:37
发文本代码及文本错误信息
请输入待转换的图片名称:C:/Users/86188/Desktop/pic.png
Traceback (most recent call last):
File "C:\Users\86188\AppData\Local\Programs\Python\Python310\lib\site-packages\PIL\Image.py", line 2957, in open
fp.seek(0)
AttributeError: 'str' object has no attribute 'seek'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\86188\Desktop\love.py", line 36, in <module>
main()
File "C:\Users\86188\Desktop\love.py", line 30, in main
texts = pic2ascii(pic, asciis, zoom, vscale)
File "C:\Users\86188\Desktop\love.py", line 4, in pic2ascii
img = Image.open(pic)
File "C:\Users\86188\AppData\Local\Programs\Python\Python310\lib\site-packages\PIL\Image.py", line 2959, in open
fp = io.BytesIO(fp.read())
AttributeError: 'str' object has no attribute 'read'
Lijingyang 发表于 2022-3-30 14:27
库我安装的呢,我直接将论坛上的代码复制粘贴过来的可是不行
很明显是库没安装 小鬼 发表于 2022-3-31 14:21
很明显是库没安装
已经解决了,谢谢鱼油
页:
[1]