I see. So right now there are not available packages yet for Tkinter in Python 3.1
I want to display preview, or let a user browse and select his own picture, and I dont want to limit it to GIF files (well, not all user are power users that understand the difference, for them a picture is a picture). But I guess I have to wait for now until I can do that with Tkinter. The best I can do for now is combining the program with other packages (like pygame).
Here is a sample code in simple (no class) style ...
# display an image using PyQT (simple coding)
# PyQT free from:
# Windows installer as of 27jul2009: PyQt-Py3.1-gpl-4.6rc1-1.exe
# tested with PyQT4.6 and Python3.1
from PyQt4.QtCore import *
from PyQt4.QtGui import *
app = QApplication(sys.argv)
# create the window/frame
win = QWidget()
# the image file can be a .jpg, .png, ,gif, .bmp image file
# if not in the working directory, give the full path
# (filenames are case sensitive on Ubuntu/Linux)
image_file = "Dimension.jpg"
image = QPixmap(image_file)
width = image.width()
height = image.height()
# show the image name and size in the window title
info = "%s (%dx%d)" % (image_file, width, height)
# use a label to display the image in
label = QLabel(win)
label.setGeometry(10, 10, width, height)
From the thread GUI programming, I see a lot of examples using PyQt.
Is it more powerfull than Tkinter? Should I stick with Tkinter or should I learn PyQt? The problem with the JPG stuff is only something minor. Im referring to more general (all in one) thing.
Im a python newbie. I want to focus on one thing first before learning all other packages. Currently I'm just using Tkinter and pygame. If PyQt is better than Tkinter, than I would switch to it and focus to it.