I have already made a post on how to open a JPG file but I now plan to use GIF image files. Can someone show me a sample code example on how to open GIF image files whenever you click buttons on TKinter GUI in Python? Thanks.
stevewilliams02 0 Newbie Poster
Recommended Answers
Jump to PostSomething like this usaully works:
# Python2 (for Python3 use tkinter) import Tkinter as tk def show_image(): lbl['image'] = image_tk root = tk.Tk() # pick a .gif image file you have in the working folder # or give the full path fname = "House.gif" image_tk = tk.PhotoImage(file=fname) …
All 3 Replies
Reply to this topic Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.