pygame vs tkinter.

前端 未结 2 1849
暗喜
暗喜 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.

    0 讨论(0)
  • 2021-02-02 18:35

    Pygame is normally used to create games though I would recommend using the arcade library instead. Pygame does not help you to create GUIs. instead you should use tkinter which is specifically designed for GUIs. For your project I would recommend using tkinter. Tkinter helps you create labels, buttons and stuff pygame helps you make graphics and stuff

    0 讨论(0)
提交回复
热议问题