Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pygame vs tkinter.

I've been searching the web and reading about GUI development in Python and have read that Tkinter is one of the best GUI toolkits for Python. But I also know that Pygame is a library that can be used for GUI. As i'm fairly new to programming, could somebody please explain the differences between Pygame and Tkinter, and which should be used in what occasion. Which would be a better choice for a chess engine GUI. Thank you very much in advance.

like image 648
stensootla Avatar asked May 19 '12 19:05

stensootla


People also ask

Does pygame use Tkinter?

PYGAME and TKINTER in HARMONY. Despite what is said on some forums, Tkinter, the middle weight python GUI, works quite well in conjunction with pygame, the python SDL layer - at least when pygame is not in full screen mode. Pygame has been used as the graphics/media engine for many serious application (eg.

Can you use pygame as a GUI?

Pygame GUI is a module to help you make graphical user interfaces for games written in pygame. The module is firmly forward looking and is designed to work on Pygame 2 and Python 3.

What is better than Tkinter?

Anyhow, in most situations, the best solution is using PyQt, considering the advantages and disadvantages of both PyQt and Tkinter. GUI programming with Qt is created around signals and slots for communication amongst objects.

Is pygame still used?

Pygame is not commonly used commercially.


1 Answers

First, tkinter is definitely not the best GUI toolkit for python. It's one of the simplest and usually comes with the python interpreter. But it's not as powerful as Qt, wx or Gtk.

pygame is - as it's name states - a package designed to allow to create games in python very easily, not to create GUIs. As such it provides event handling, graphics sound bindings and some other things useful to write games, and it's written on top of SDL.

So if you want to write a GUI-application, don't use pygame.

On the other hand GUI toolkits can also be used to write games. Generally I would say they are much more versatile then something like pygame, but they're not really comparable. It all depends on the application you want to write. The choice of the right tool is usually something very important.

like image 106
mata Avatar answered Oct 18 '22 04:10

mata