AttributeError:模块“ PIL.Image”没有属性“ load”

时间:2020-09-23 16:45:56

标签: module attributes load attributeerror

import pyautogui
from PIL import Image, ImageGrab
import time
def hit(key):
    pyautogui.keyDown(key)

# def draw():
    

def takeshot():
    Image=ImageGrab.grab().convert('L')
    
    return Image

if __name__ == "__main__":
    time.sleep(3)
    takeshot()
    data = Image.load()
    print(data)
    for i in range(34, 45):
        for j in range(45, 67):
            data[i, j] = 0

    Image.show()

我不知道为什么会出现此错误:

AttributeError:模块'PIL.Image'没有属性'load'

请帮助!

0 个答案:

没有答案