I am copying a code from online example how to search the resolution of an image.
import PIL
batman = PIL.Image.open("image.jpg")
batmobile, batplane = batman.size
print(batmobile,"x",batplane)
There is attributeError. PIL has no attribute name 'Image'.
from PIL import Image
batman = Image.open"image.jpg")
If I changed like this, the code can run perfectly. So, I used print(dir(PIL))
to see attributes. There is no 'Image' attribute. I don't understand.
import datetime
batman = datetime.datetime.now()
is the same as
from datetime import datetime
batman = datetime.now()
right? I downloaded 'pillow' with pip.