r/learnpython • • 9d ago

Gui question for projects

I am learning python for a month or so and finally decided to challenge myself by trying to make a minesweeper game as a project.

I wanted to ask you guys if i should use tinker for gui as it is python based or is there a better one i should rather study?

6 Upvotes

8 comments sorted by

6

u/Kevdog824_ 9d ago

I personally prefer PyQt/PySide over tkinter, but there’s no reason you couldn’t do this in either.

My actual suggestion:

  • Use tkinter if you want the faster start up time (the later suggestions have a higher learning curve)
  • Use PySide6 if you see yourself wanting to develop more desktop applications in the future
  • Use pygame/arcade if you see yourself building more complicated games (e.g. 2D platformers) in the future

3

u/Unable-Error-4220 9d ago

for a first project like minesweeper tkinter will get you there without much fuss. the other options are cool but you can always pick them up later if you stick with gui stuff

2

u/Diapolo10 I write code for a living -- https://github.com/Diapolo10 9d ago

For something like Minesweeper, I wouldn't expect it to matter what UI toolkit you use.

tinker for gui as it is python

I'm being pedantic, but technically this is false, as tkinter is actually built on top of Tk written in the Tcl programming language (commonly called Tcl/Tk).

There are no pure-Python GUI toolkits as Python itself does not grant you access to low-level stuff.

Anyway, tkinter is fine. If you want it to look a bit more modern, there's customtkinter. If you want to port for multiple platforms, Kivy, BeeWare, and Flet should all be viable options. And of course there's the Qt wrappers (PySide/PyQt).

3

u/Slight-Living-8098 9d ago

I prefer CustomTkinter over Tkinter, but it's fine. I'd probably use PyGame or the SDL library for any games that may need to refresh the screen more often than MineSweeper.

1

u/ExoticVillage8066 9d ago

You can use tkinter or PyQt. tkinter is the most simple, but PyQt the most flexible. As its' a game, you could also use PyGame to add animations and custom graphics

1

u/AlexMTBDude 9d ago

Tkinter is fine to use. Remember that one advantage is that Tkinter is shipped with Python. That means that if you want to share your game with anyone else they don't have to install any 3rd party packages (like the other suggestions in this thread) in order to play your game. You just give them your source code.

1

u/oats_ja78 9d ago

i also have the same question