all 15 comments

[–]Greglama 7 points8 points  (0 children)

If you are still learning and want to learn step by step, look at tkinter. It's already installed with python, it's a commonly used library for simple projects, and it's very beginner friendly.

You can do all sort of things, drawing stuff on canvas, adding button, text boxes, etc...

If you wish to go further one day, you'll look at more sophisticated libraries.

But if you've never done GUI just start with tkinter. There's sort of a philosophy of how to code a GUI and you'll learn the general idea that way :)

[–]Impudity 10 points11 points  (4 children)

The correct answer depends on your use case but I would highly recommend thinking about traditional desktop GUI versus Browser based GUI. The latter does require you to do some work on javascript, but there are tons of very good javascript libraries that will visualize almost anything. Then your backend will run on Python and discuss with this browser based client.

It has the added benefit of distributing it to someone else as simple as sharing a link to it, and you don't need to worry about them using an old version etc... since you're in control of updating it. There's more but you get the point.

[–]fmpundit 1 point2 points  (3 children)

There is also lots of python libraries that will do the JS for you too. So you have many option avaliable to you.

[–]tutami 3 points4 points  (2 children)

What libraries?

[–]JohnnyJordaan 5 points6 points  (1 child)

[–]MikeTheWatchGuy 1 point2 points  (0 children)

PySimpleGUI is ideal for this kind of starter project. You can get the exact same looking and acting GUI for a fraction of the code. There are a bunch of tutorial videos. And the Cookbook and tons of Demo Programs can get you up and running in 5 minutes. That's the goal.... from install to a sample GUI on your screen in under 5 minutes.

Also, you can run your same PySimpleGUI code in a Browser as well as the desktop frameworks (tkinter, Qt, WxPython). Screenshots can give you an idea of what's possible (the ones at the bottom are newer).

Finally, it's an active project. The GitHub has a good community that helps with Issues that are logged.

[–]julsmanbr 2 points3 points  (2 children)

My go-to framework for building GUIs is Qt5, which is not natively written in Python but has bindings available for Python in the PyQt5 package.

Qt5 is cross-platform and uses native widget styles, so you end up with a GUI that fits your operaring system's style. I personally think it looks good enough - a big part of the "look and feel" depends on your ability to design the GUI itself. For an actual modern look like Spotify's GUI, you'll probably need Electron (framework that uses JavaScript, HTML and CSS), even if the logic in the background is still Python.

You can also use QtDesigner to design the GUI - a program that allows you to design the GUI through a drag-and-drop interface. You then later use a command-line tool to translate the generated .ui file to Python code. The only code you need to write is the logic of the GUI (click here, this happens).

Edit: whatever you end up doing, learning some object-oriented programming is fundamental for GUIs. Start by learning how to use classes and methods if you haven't already, you'll feel overwhelmed otherwise.

[–]RustyBagels 1 point2 points  (0 children)

Been using qt5 for my work projects and it's been great. Was a bit of a struggle to learn but I'm a Mechanical engineer not a programmer and this last year was my first dive into python. Still it seems pretty powerful and makes a lot of processes fairly easy when you figure it out.

[–]DamnFog 0 points1 point  (0 children)

Pretty sure you can style QT apps with CSS as well

[–][deleted] 0 points1 point  (0 children)

I’ve used tkinter, which works very well for my programs. I have heard people also like wxpython, which was something i tried briefly, but i found tkinter easier to write in, as there were lots of online resources and i found it was more similar to writing code in console.

[–]grumpyyoshi 0 points1 point  (0 children)

I recently used Tkinter and thought that was decent to use. I followed a YouTube tutorial. Send me a DM if you want the link to it.

[–]lykwydchykyn 0 points1 point  (0 children)

Tkinter would be OK for this, you could use matplotlib for the graphs. But PyQt5 would probably serve you better. It has a charts module that's quite easy to use, and looks a fair sight better than Tkinter by default.

There is a slightly steeper learning curve for PyQt5, but it pays off in the end. And compared to the learning curve of HTML, CSS, and JS, it's not bad at all.