我正在编写一个问题的解决方案,我遇到了一个关于PIL图像方法的问题。你知道吗
choice = input("Would you like to save the maze as a file, Y/N?").upper()
if choice == "Y":
canvas.update()
canvas.postscript(file="maze.eps", colormode='color')
img = Image.open("maze.eps")
但是,我收到以下错误消息:
Traceback (most recent call last):
File "C:\Users\Matthew\Desktop\NEA\Technical Solution\mazeVisualiser.py", line 66, in <module>
img = Image.open("maze.eps")
AttributeError: type object 'Image' has no attribute 'open'
但在学习PIL模块时,我知道这是有效的:
from PIL import Image
img = Image.open('brick-house.png')
任何帮助将不胜感激,因为这已使我完全陷入困境。你知道吗
试试这个:
相关问题 更多 >
编程相关推荐