Thanks a lot for your patience.
I put the gif file to a folder called fig in my desktop.
dirpath = './fig'
still got error:
Traceback (most recent call last):
File "11.py", line 238, in <module>
img.config(image=gifsdict[imgname])
NameError: name 'imgname' is not defined
You should reply to the python list. That way everyone gets the
benefit of your questions.
The problem is here:
-
def list_entry_clicked(*ignore):
-
imgname = L.get(L.curselection()[0])
-
img.config(image=gifsdict[imgname])
-
L.bind('<ButtonRelease-1>', list_entry_clicked)
-
I think the main problem is that the line
`img.config(image=gifsdict[imgname])' is supposed to be part of
`list_entry_clicked' and it isn't.
What you want to do (maybe? I made some assumptions):
-
def list_entry_clicked(*ignore):
-
imgname = L.get(L.curselection()[0])
-
img.config(image=gifsdict[imgname])
-
-
L.bind('<ButtonRelease-1>', list_entry_clicked)
-
That _should_ work, but it is untested.
Matt