Problems Using PIL 1.1.7

Trivial

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

leads to 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

Not sure if I missed something, kindly help.

+3
source share
2 answers

Using:

Image.open()

It is case sensitive.

+4
source

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

+1
source

Source: https://habr.com/ru/post/1730021/


All Articles