[Tutor] educational

Ben Finney ben+python at benfinney.id.au
Sun Mar 9 09:57:05 CET 2014


Welcome, Michael!

MICHAEL BASHAGI <myakayebashagi at gmail.com> writes:

> when i run those codes i get this error message:-

When showing an error, please show the entire traceback; it usually
contains information useful for diagnosing the problem.

> AttributeError: type object 'Image' has no attribute 'open'

In this case, I'm fairly sure the line producing this error is::

    image = Image.open("logo.jpg")

And Python is correct, the ‘Image’ type has no ‘open’ attribute. What
leads you to think that would work? If there is some article online
telling you to use that, it's incorrect; please help us to correct that.

It's best not to guess what attributes are in a type (otherwise known as
the “API” for the type). Instead, consult the documentation. For
Tkinter, that is <URL:http://www.python.org/topics/tkinter/>.

-- 
 \        “Most people, I think, don't even know what a rootkit is, so |
  `\     why should they care about it?” —Thomas Hesse, Sony BMG, 2006 |
_o__)                                                                  |
Ben Finney



More information about the Tutor mailing list