I know wxpython is supposed to be better than tkinter, but I can't find any easy to understand tutorials on how to begin using wxpython. But anyway. How can I get tkinter to load up a jpg?
I know wxpython is supposed to be better than tkinter...
Not if your code needs to run on a Mac ...
But anyway. How can I get tkinter to load up a jpg?
The best bet is to get PIL, the Python Imaging Library. Link here.
Then you can construct some simple code like
import Image, ImageTk im = Image.open(filename) # loads a wide variety of file types as a # PIL image. The PIL image has a # rich set of methods tkim = ImageTk.PhotoImage(im) # Converts to Tkinter-friendly # image type
From there, you can pass the tkim object as a parameter to anything that will accept an image: a Label(), a Button(), a Canvas() ...
Hope it helps,