簡體   English   中英

枕頭圖像功能不可調用

[英]Pillow Image functions not callable

我是使用 python 的新手,對於我的第一個項目,我決定用 Pillow 做點什么。 在遇到這個問題之前我才剛剛開始, Traceback (most recent call last): File "C:/Users/Daniel Li/images/test.py", line 5, in <module> print(cookie.size()) TypeError: 'tuple' object is not callable這是我的代碼,

from PIL import Image

cookie = Image.open("image.ppm")

print(cookie.size())
cookie.show()

我嘗試卸載並重新安裝 Pillow,我很確定我安裝正確。 請幫忙

print(cookie.size())

Image.size是一個字段,而不是 function 或方法。 去掉括號:

print(cookie.size)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM