Tutorial by Examples

Tkinter support .ppm files from PIL(Python Imaging Library), .JPG, .PNG and .GIF. To import and image you first need to create a reference like so: Image = PhotoImage(filename = [Your Image here]) Now, we can add this image to Button and Labels like so using the "img" callback: Lbl ...
In order to display a gif, you need to show it frame by frame sort of like an animation. An animated gif consists of a number of frames in a single file. Tk loads the first frame but you can specify different frames by passing an index parameter when creating the image. For example: frame2 = Photo...

Page 1 of 1