开发者

Problems using PIL 1.1.7

开发者 https://www.devze.com 2022-12-17 08:32 出处:网络
The trivial import Image im = Image.OPEN(\'C:\\abc.bmp\') results in the following exception Traceback (most recent call last):

The trivial

import Image
im = Image.OPEN('C:\abc.bmp')

results in the following exception

Traceback (most recent call last):
  File "<pyshell#1>", line 1, in <module>
    im = Image.OPEN('C:\Documents and Settings\umair.ahmed\My Documents\My Pictures\avanza.bmp')
TypeError: 'dict' object is not callable
开发者_JS百科

not sure if i am missing something, kindly help.


Use:

Image.open()

It's case-sensitive.


I don't think the error message came from your input, because the file names are different, but you should not use 'C:\abc.bmp', in your open() call, but use either C:/abc.bmp, or r'C:\abc.bmp'. Backslash is an escape character in Python.

0

精彩评论

暂无评论...
验证码 换一张
取 消