r/learnpython • • Feb 20 '24

What python GUIs do you recommend?

Hi all! With the recent planned 'sunset' of pySimpleGUI 4 and questionable license for psg 5 which GUI library do you recommend? About my work: I'm a scientist in a field on nanophysics and I have to put many graphs into my programs and prefer GUI building to be the lesser problem;)

Upd: I worked for a year or so with psg but now want to move

Upd2: Big thanks to all of you for the suggestions! If anyone curious, I settled with DearPyGUI as it seems to meet all my needs and isn't (sorry) web-based.

Upd3: Their digital signature is so broken, it required like 30 minutes to tamper their code LOL

111 Upvotes

68 comments sorted by

116

u/jimtk IdontChat Feb 20 '24

Tkinter: Easy, quick, in standard library. Not too many options, looks awful, cracks at the seam on complex things, documentation is between bad and non-existent. Custom-tkinter (look for it on github) makes it look better.

Pyside6/PyQt6: Extremely powerful, has everything and 3 kitchen sinks, looks as good as you want, reliable. Pretty big learning curve, documentation is geared to c++, once you get in the qt boat you stay on the qt boat.

html/CSS/Javascript. As complex as you want, good learning opportunity, can look amazing, usable on phone and tablet, final app is easy to distribute and update. Requires a server (that's huge!), need to learn multiple languages and frameworks so big learning curve, cannot center a div :) !

4

u/xtotdam Feb 20 '24

Thank you for your suggestions. I am now looking in the direction of dearpygui, as it looks nice and seems to be fast and has many different plot features built-in

28

u/reddaxetheintrovert Feb 20 '24

Very nice description of Tkinter 🤣🤣🤣

19

u/_UnreliableNarrator_ Feb 20 '24

Oh so it's not my fault my one attempt at a tkinter app visually looks like dogshit from 1993

12

u/Playful_Round_6530 Feb 20 '24

cannot center a div got me 🤣🤣

7

u/pigguy35 Feb 20 '24

Yeah how does tkinter have such garbage documentation. I spent like an hour just trying to find a full list of controls, let alone how to you use them.

5

u/TrooperStorm316 Feb 20 '24

Sidenote: Ttkbootstrap makes tkinter look less awful

https://ttkbootstrap.readthedocs.io/en/latest/#sample-themes

5

u/Kooky-Most5115 Feb 20 '24

I agree with this post, I'd just say, that I've found that using chatgpt got me past the pyside6 learning curve pretty quickly (although I'd spent a couple years making tkinter apps as experience beforehand).

2

u/MaveDustaine Feb 20 '24

I use Tkinter for a script in my org, it's served me great so far! I added three tabs, buttons, text boxes, all the things!

1

u/c_299792458_ Feb 20 '24

Requires a server (that's huge!)

The http.server module is a quick way to stand up a server for localhost applications.

1

u/Efficient-Table-3226 Feb 20 '24

Interesting. Are there any guides that cover the basics of that?

The more I use tkinter the more I hate it and I'd love to try something else that is not PySide/PyQT.

Last I looked into using html/css/js with python everyone pointed me to using flask or django which seem less suitable for a localhost desktop application.

1

u/CptBadAss2016 Feb 21 '24

Why specifically not Qt?

1

u/TabAtkins Feb 20 '24

can't center a div

Sorry you're still supporting IE8 somehow. Sucks to be you, but not relevant for others.

(Flexbox makes this simple. Grid makes it trivial.)

1

u/FerricDonkey Feb 21 '24

Despite agreeing with your description, I still generally use tkinter, because it's fairly easy to get basic things going, and I never need anything super complicated with it.

1

u/sylfy Feb 21 '24

localhost is also a server.

1

u/dukea42 Feb 20 '24

Very nice description of Pyside/PtQT. You find yourself using one kitchen sink and the guide you are using talking about a different sink.

35

u/Allanon001 Feb 20 '24

Flet or Nice GUI. Both allow for web or desktop apps and have chart, diagram, and table widgets built in.

3

u/xtotdam Feb 20 '24

Wow, thanks, I will look into these in the future, they look promising

4

u/MasturChief Feb 20 '24

+1 for nicegui

3

u/Timoroader Feb 20 '24

I have used NiceGUI for prototyping and simple applications, works really well. Can only recommend it.

2

u/moonandeye Feb 20 '24

I saw Nice GUI repo, it’s awesome. Maybe I’ll try it next time

1

u/Defalt0_0 Mar 04 '25

looks wonderful, thank you.

1

u/uppblomstring Feb 20 '24

Currently using flet and enjoying it a lot, recommend it 100%

0

u/[deleted] Feb 20 '24

[deleted]

2

u/d_a_v_e_h Feb 20 '24

Not sure about flet, but you can do that using DroidScript.... they've just released Python support and sensors are accessible (as well as most other native Android features)
Note: You don't have to edit code on mobile, you can connect it to a web browser for a full sized IDE and it can build both APKs and AABs.

2

u/Allanon001 Feb 20 '24

I know Flet can detects phone shakes but not sure of other sensors.

9

u/[deleted] Feb 20 '24

We use plotly dash at work for building data focused web apps.

3

u/xtotdam Feb 20 '24

Plotly is super cool for 3D data, I agree!

2

u/nervacka Feb 20 '24

Same here, its easy and the results are always beautiful!

1

u/cedenof10 Feb 20 '24

would you mind sharing an image of an example?

2

u/[deleted] Feb 20 '24

I can’t I’m afraid, it’s super proprietary data. But imagine web app with a couple of drop downs at the top and below a row of tabs. You can select a project and a scenario with the drop downs and then view plots of the different analyses on each tab.

Plotly plots are interactive, you can zoom, hover for datatips and filter as you like. You can also assign callbacks to UI elements so calculations can be done on the fly.

3

u/this_knee Feb 20 '24

What?!!! Nooooo! That’s awful! What an awful choice. They totally removed the source code from the open source repo for pysimplegui. What a turn to make. Disappointing.maybe find more answers here

4

u/xtotdam Feb 20 '24

Haha, they also banned me from issues for asking questions)

1

u/WoefulStatement Mar 17 '25

Well I mean, issues are for reporting issues, not for asking questions.

Not to justify their other actions, but this particular one might be reasonable.

2

u/xtotdam Feb 20 '24 edited Feb 20 '24

Exactly, this is a huge red flag. However I was using it for a year or so and it was nice, but now it is time to move on

1

u/el_extrano Feb 20 '24

Wait so what happens to stuff we already made and deployed? Wtf

1

u/xtotdam Feb 21 '24

Version 4 is licensed under LGPL license, but I'm not a lawyer to describe the license transition correctly. I personally saved a 4.60.5 wheel from Pypi and quickly switched to another GUI for my current projects. Luckily the fact that I'm scientist and my management doesn't care I can do it)

0

u/MrOnlyFan_Leaves Feb 21 '24

That's the fun part, we wait and see where they want to fuck us. 🤗

10

u/dj2ball Feb 20 '24

I've usd NiceGUI a fair bit for modern feeling web ui's. Its basically an API for running Vue components styled with css directly in your python code. I've found it very solid for prototyping and throwing together quick GUIs on top of my regular scripts.

1

u/RexehBRS Feb 20 '24

This hurts as was looking at web UI connectors and didn't want electron complexity so just redone everything in pyside6..

Vue would have been fab :(

3

u/[deleted] Feb 20 '24

[removed] — view removed comment

2

u/dj2ball Feb 20 '24 edited Feb 20 '24

It has boilerplate css based on Tailwind styling baked in, yes. You can also write custom css directly in your python file to pass to components to customise them more. Check the library out the docs have some great examples.

9

u/dumper514 Feb 20 '24

Have you tried streamlit?

2

u/Dilutant Feb 20 '24

I have tried every python gui package under the sun and nothing is as good looking and simple as streamlit. Agree that it doesn’t scale well for complex tasks but for simple workflows it’s so much easier than pyside.

1

u/JuicyJfrom3 Nov 19 '25

Looks great but the lack of local file directories and the way it handles state is an absolute killer. There are other work arounds as well but it is very pretty.

6

u/Kooky-Most5115 Feb 20 '24

Pyside6. From what I understand, you'll have no licensing issues, and although it's a bit more complicated than tkinter, it has so much more/better functionality, specifically when it comes to embedded graphs, multiprocessing/multi threading etc. ive also found that with a bit of chat gpt usage you can get things up and running quite quickly, and you'll be understanding and using it in no time.

3

u/Kooky-Most5115 Feb 20 '24

Also, I've used tkinter and also web apps using eel. Tkinter doesn't have great support for a lot of things I ended up needing to do, and web apps feel bloated + using JavaScript html css + not great support for embedding matplotlib graphs.

1

u/ProjectSnowman Feb 20 '24

I really like Textual. For basic inputs and outputs it does a great job and it’s pretty lightweight.

1

u/xtotdam Feb 21 '24

This one looks really cool, thanks!

1

u/Quillox Feb 20 '24 edited Feb 20 '24

I have to recommend you make a web app, it will make sharing you results much easier. Use Django and follow the model view control pattern. Making a relational database for your data is a fantastic exercise and will again make your data more accessible.

Some people recommend Flask because it is "simpler", but I'd argue that using Django from the beginning and not using their more complex features is just as simple. And it has the added bonus of when you eventually want to use these features, and you will at some point, Django makes it much easier.

ETA: Try out Plotly for your graphs! It's a very simple way of getting interactive graphs. Just export them as html that can be directly used in the Web app.

2

u/xtotdam Feb 20 '24

Thanks! I used Django several times but for simple web apps solely. I am afraid it won't fit for the simulation program that has to be responsive and will eventually be rewritten or forgotten

3

u/hello_friendssss Feb 20 '24

Try out Plotly for your graphs! 

And plotly dash :)

2

u/[deleted] Feb 20 '24

Flet is kinda cool, but IDK how mature it is

2

u/[deleted] Feb 21 '24 edited Aug 19 '24

fine somber murky languid wine growth retire automatic dime rob

This post was mass deleted and anonymized with Redact

1

u/[deleted] Feb 20 '24

I’ve been enjoying pyqt recently. Found it very easy to block out a gui with the visual designer program and then add functionality inside the code

1

u/hugthemachines Feb 20 '24

I make a little gui once in a blue moon. I usually use Easygui, I think it is a wrapper for tkinter. It is very easy to use, though.

1

u/murilomm192 Feb 20 '24

I too tried every way to make a GUI since my work involves sharing my scripts with various non-coding coworkers.

To me, nothing beats streamlit, Sure it is not well suited for more complex stuff, but the convenience of clicking a button the the app is published with a link that I can just share makes it invaluable to me.

When I cross that threshold of complexity I usually go directly to javascript land, Using Svelte more and more these days.

1

u/DataSynapse82 Feb 20 '24

I would suggest to use Streamlit, it is really straight forward to build web apps to showcase graph/charts or dashboards, it is easy to use also to implement machine learning models within the app, any question let me know

1

u/mmmmmmyles Feb 20 '24

For web-based, there is marimo. It's more of a notebook, but you can convert the notebook to an application (by hiding the code) in the end.

E.g. here is a program about The Mandelbrot Set

1

u/pyeri Feb 21 '24

My favorites are Tkinter and PySide5. Both are extensive and time-tested libraries, and widely used. I usually prefer the former for most typical GUI apps.

0

u/[deleted] Feb 20 '24

[deleted]

1

u/xtotdam Feb 20 '24

Yes, I created one Android app with it. It was kind of an adventure:)

0

u/[deleted] Feb 20 '24

[deleted]

1

u/Fabiolean Feb 20 '24

I think this project is super cool but the old name was a lot better. Used to be called Pynecone.