0
我試圖做枕頭以股代息,但我有一個實例方法錯誤 的代碼是類似的東西PIL屬性錯誤
import StringIO
import subprocess
from PIL import Image
command = "fswebcam -q --no-info --no-banner --jpeg -d /dev/video0 -i 0 -r 100x75 -"
imageData = StringIO.StringIO()
imageData.write(subprocess.check_output(command, shell=True))
imageData.seek(0)
im = Image.open(imageData)
print buffer1[1,1]
,當我試圖運行它們,我得到
File "prueba.py", line 17, in main
print im[1,1]
File "/usr/lib/python2.7/dist-packages/PIL/Image.py", line 528, in __getattr__
raise AttributeError(name)
AttributeError: __getitem__
那又怎麼了? 由於事先