Question Regarding PIL and PhotoImage classes

Fredrik Lundh fredrik at pythonware.com
Sat Apr 23 06:51:00 EDT 2005


Harlin Seritt wrote:

> Why is that I can only get the PhotoImage class to show up when I write
> a straight procedural script (no object orientation) but not when I try
> to use object-orientation?
> 
> These two scripts in theory should produce the same results but they
> don't. Is there any reason why?

in the second example, the "photo" variable is garbage-collected when the
method returns.

see the note on this page for more info:

    http://effbot.org/zone/tkinter-photoimage.htm

</F>




More information about the Python-list mailing list