pygame vs tkinter.

前端 未结 2 1848
暗喜
暗喜 2021-02-02 17:40

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

2条回答
  •  生来不讨喜
    2021-02-02 18:34

    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.

提交回复
热议问题