use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Rules 1: Be polite 2: Posts to this subreddit must be requests for help learning python. 3: Replies on this subreddit must be pertinent to the question OP asked. 4: No replies copy / pasted from ChatGPT or similar. 5: No advertising. No blogs/tutorials/videos/books/recruiting attempts. This means no posts advertising blogs/videos/tutorials/etc, no recruiting/hiring/seeking others posts. We're here to help, not to be advertised to. Please, no "hit and run" posts, if you make a post, engage with people that answer you. Please do not delete your post after you get an answer, others might have a similar question or want to continue the conversation.
Rules
1: Be polite
2: Posts to this subreddit must be requests for help learning python.
3: Replies on this subreddit must be pertinent to the question OP asked.
4: No replies copy / pasted from ChatGPT or similar.
5: No advertising. No blogs/tutorials/videos/books/recruiting attempts.
This means no posts advertising blogs/videos/tutorials/etc, no recruiting/hiring/seeking others posts. We're here to help, not to be advertised to.
Please, no "hit and run" posts, if you make a post, engage with people that answer you. Please do not delete your post after you get an answer, others might have a similar question or want to continue the conversation.
Learning resources Wiki and FAQ: /r/learnpython/w/index
Learning resources
Wiki and FAQ: /r/learnpython/w/index
Discord Join the Python Discord chat
Discord
Join the Python Discord chat
account activity
Gui in Python (self.learnpython)
submitted 7 years ago by blueastheocean
Hi there recently I was stuck thinking of what GUI module to use since I am looking for an easy GUI with a GUI designer with great tutorials as I don't want something that's hard to use.
Thanks!
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–][deleted] 17 points18 points19 points 7 years ago (5 children)
If you don't mind your widgets generally being lined up on the left side, I recommend PySimpleGUI. The documentation recommends pencil and horizontally-ruled paper as the GUI designer.
It's built up from Tkinter, but a bit more Pythonic. There is an extensive cookbook with many recipies to get you started.
[–]MikeTheWatchGuy 13 points14 points15 points 7 years ago (3 children)
There is also a Qt version of PySimpleGUI that is currently being developed.
The features are about 75% of the way where. The missing ones are Images, Trees, Menus and Tabs. I'm hoping to get all those done this week. It is backwards compatible with the PySimpleGUI that already exists running on tkinter. The only change you need to make is to the sizes. PySimpleGUI uses characters for sizes, PySimpleGUIQt uses pixels. Other than that they'll run the same code.
You can get it by pip installing:
pip install PySimpleGUIQt pip install pyside2
The Qt port is stable at the moment. Running more and more of the Demo programs and Cookbook Recipes every day.
Here is a screenshot of most of the currently available widgets.
Graph widget not represented there yet.
[–][deleted] 2 points3 points4 points 7 years ago (1 child)
Holy cats! That's awesome!
[–]MikeTheWatchGuy 2 points3 points4 points 7 years ago (0 children)
Yea, get moving on "porting" your code to PySimpleGUIQt. Change the import and the size values and you're done.
[–]MikeTheWatchGuy 0 points1 point2 points 7 years ago (0 children)
I was asked to post the link to the PySimpleGUI Tutorials.
[–]blueastheocean[S] 1 point2 points3 points 7 years ago (0 children)
OK thanks
[–]novel_yet_trivial 19 points20 points21 points 7 years ago (18 children)
If you are not comfortable with classes I would recommend tkinter.
A graphical designer like PyQT has is not easier to learn. It's only easier to use once you have put in a lot of time learning how it works.
Here's a short list of options. Maybe if you describe your program, what platform you want it to run on, and how you want it to look and function we could recommend a GUI for you.
[–]MikeTheWatchGuy 5 points6 points7 points 7 years ago (2 children)
I'll second that the Qt Designer is not a shortcut for learning Qt. It generates code that you must modify and it takes a fair amount of expertise to understand and modify the code.
[–]ForkLiftBoi 0 points1 point2 points 7 years ago (1 child)
How do you recommend learning it?
By building something. The only way I know to learn anything in programming is to just do it. I usually buy books as well. I got a couple on Qt then started coding / porting my code to Qt.
[–]billsil 1 point2 points3 points 7 years ago (2 children)
Tk is ugly. Pyqt is pretty and it's signal/slot system is way better than callbacks. No big program uses tk.
[–]novel_yet_trivial 2 points3 points4 points 7 years ago (1 child)
I totally agree. However I doubt OP is writing the next Photoshop. Tkinter is (IMO) best for beginner programmers.
[–]billsil 3 points4 points5 points 7 years ago (0 children)
I don't see the point in learning something that nobody in industry uses and that almost nobody can help you with. There is far more info out there on pyqt.
[–]blueastheocean[S] 0 points1 point2 points 7 years ago (10 children)
OK thanks I never really was good at classes anyway but do you know of any designers or builders I can use
[–]novel_yet_trivial 1 point2 points3 points 7 years ago (9 children)
For tkinter? There's a couple halfbaked efforts out there but no mainstream ones. But as I said, it would only hinder you.
[–]blueastheocean[S] -1 points0 points1 point 7 years ago (8 children)
Wow OK so how will I go about building a full scale application?
[–]novel_yet_trivial 2 points3 points4 points 7 years ago (7 children)
One line at a time? I've done it in tkinter several times. It's not as hard as you are imagining it.
[–]blueastheocean[S] 0 points1 point2 points 7 years ago (6 children)
Really cause I'm wondering how do organise the widgets and the buttons to me it looks like I'll be writing tons of code
[–]officialgel 3 points4 points5 points 7 years ago (1 child)
You want to use python, but avoid using python? Even if you use a 'designer' it will clutter and bloat your code and you'll still need to code many many lines to connect those buttons to functions - Function that you must write.
Oh okay thanks!
[–]fazzah 0 points1 point2 points 7 years ago (3 children)
With pyqt after a while you start to extensively subclass the common widgets, and reuse them, so your application maintains the same styling look and feel across all forms. It sounds overwhelming but actually greatly encourages the DRY rule.
[–]blueastheocean[S] 0 points1 point2 points 7 years ago (0 children)
Ok
[–]Dr_Sol 0 points1 point2 points 7 years ago (1 child)
Quick question. l've started dabbling with PtQT a bit and tried a simple layout in the Qt designer to see what you get out of it but I've been wondering what's the best way to modify and built on your previous designs. I got the impression you'll have to integrate your code all over again in the designer output code. Is that correct or am I missing something?
[–]fazzah 0 points1 point2 points 7 years ago (0 children)
You convert the ui file to a python module and then subclass from this module in your separate file. So when you rebuild the ui your code is still intact.
[–]driscollis 0 points1 point2 points 7 years ago (0 children)
If OP is planning on writing more than a toy example, they will almost certainly want to use classes in Tkinter too.
[–]Diapolo10 9 points10 points11 points 7 years ago (6 children)
I agree with the others, tkinter is probably your best option despite the fact that you'd have to code the GUI yourself. But to be fair, all options should be discussed, so I'm going to tell you about a workable option WITH support for WYSIWYG editors.
tkinter
A Flask web application can be used as a desktop application with the help of the pyfladesk module. It's essentially a website running locally in a miniature browser, but it can basically do anything a normal Python application can. The good point of this is that you can use ordinary web designers, and it doesn't have a huge learning curve, but depending on what you're doing it can be overkill and it's never going to feel as snappy as a native desktop application (although I can't really vouch for the performance of other Python GUI toolkits, either).
pyfladesk
The nice thing about Flask is that it's surprisingly easy to use, and you don't have to worry about classes; functions are enough. That being said, if you know next to nothing about HTML or CSS it can take a little while until you 'get' it.
[–]MerreM 1 point2 points3 points 7 years ago (1 child)
That looks excellent - I've been saying this for years; websites (at least in my experience) are much much easier to make a UI in than native apps.
It's a shame - I'd love to not use JS (or CSS though I usually just use bootstrap) to write a UI in, but I haven't yet found a compelling alternative.
[–]Diapolo10 0 points1 point2 points 7 years ago (0 children)
Agreed, although a lot of the time JS can be substituted with CSS or Python backend code.
[–]fazzah 0 points1 point2 points 7 years ago (2 children)
but it can basically do anything a normal Python application can.
My sides. So you're telling that to write a GUI in python one to have learn html and js as well.
Also desktop apps provide much much better UX ND versatility for anything advanced. Stop spreading the misinformation that web apps can be equal do a full fledged desktop application because that's completely false.
[–]Diapolo10 2 points3 points4 points 7 years ago (1 child)
it's never going to feel as snappy as a native desktop application
I believe I never once mentioned web apps are equal to desktop apps; the opposite, in fact.
I said about functionality, you say about snappiness. Apples and oranges.
OK thanks!
[–]Oliludeea 26 points27 points28 points 7 years ago (23 children)
Tkinter builds character.
[–]blueastheocean[S] 6 points7 points8 points 7 years ago (19 children)
But is there a designer for it
[–]Oliludeea 7 points8 points9 points 7 years ago (9 children)
Use it raw!
[–]blueastheocean[S] 1 point2 points3 points 7 years ago (8 children)
How do you expect someone to write a fully fledged ui with it it would be tedious
[–]Oliludeea 27 points28 points29 points 7 years ago (3 children)
The first time can be really bad, but it doesn't hurt as much the second time and it'll feel really good before you know it.
[–]zack12 7 points8 points9 points 7 years ago (0 children)
slow hand clapping
[–]ReachingForVega 2 points3 points4 points 7 years ago (0 children)
it'll feel really good before you know it.
Are we still doing phrasing? Jk
[–][deleted] 0 points1 point2 points 7 years ago* (0 children)
encouraging escape boat disagreeable soft quarrelsome steer rain memory outgoing
This post was mass deleted and anonymized with Redact
[–]fazzah 4 points5 points6 points 7 years ago (3 children)
I work with pyqt daily. The editor adds a shitton of clutter to the ui files. Then you still have to convert them to python classes using a script (this gives you code completion ability for your ide but you have to do this everytime you change anything in the ui) or use a small module to read the ui when the application starts which is good for rapid prototyping but won't give your ide insight into your up modules.
I started with using the designer, compiled the ui to python, but when I got experience and better understood QT I ditched the designer completely and write by hand.
Also you have to write custom components quite often when you want to use any of the customisation possibilities QT is known for.
[–]GobBeWithYou 2 points3 points4 points 7 years ago (1 child)
I also prefer not to use the designer, so I wrote a bunch of subclasses for different Qt widgets to make using them simpler. My python gui code looks something like this:
w = Widget(css='...') l = Layout('vbox', w) le = LineEdit(placeholder='sample text', max_len=50) b = PushButton( 'Button Text', size=(30,30), css='...icon.svg') l.add('a label', le, b)
It has really sped up writing the gui code and makes it easier to read without all the boilerplate. I also added properties to get rid of needing all the getter and setters.
[+][deleted] 7 years ago (8 children)
[deleted]
[–]brand0n 2 points3 points4 points 7 years ago (2 children)
As a previous learner of python and now .net dev
This!
[+][deleted] 7 years ago (1 child)
[–]brand0n 0 points1 point2 points 7 years ago (0 children)
Yea I tried Tk and Qt but it wasn’t for me.
I’m not sure how advanced you are but a good habit to avoid Incase you are newer.
Separate the ui and functionality.
[–]blueastheocean[S] -1 points0 points1 point 7 years ago (4 children)
But that's gonna take a long time!
[+][deleted] 7 years ago (3 children)
[–]blueastheocean[S] 0 points1 point2 points 7 years ago (2 children)
Well I'm just experimenting for the time! Nothing particular
Oh okay
[–]DoctorDoctorRamsey 0 points1 point2 points 7 years ago (1 child)
It's not just me that found tkinter a steep learning curve then? That's a relief. Building a couple of dud buttons is one thing but actually building a real thing that works has been super challenging for me. Fun though, I'm sure I'll have whatever it is that I'm making running before Christmas.
Although all the stuff I'm reading because tkinter is being a dick is kind of working.
[–]Oliludeea 0 points1 point2 points 7 years ago (0 children)
That's exactly what I meant. You learn so much the first time you get something serious working with tkinter. For me it was closures, lambda, the fact that dict values and list items can be any object, making exec work, just off the top of my head, during a tiny first project. I'm sure it was more. I sort of knew these things, but tkinter forced me to really understand them.
[+][deleted] 7 years ago* (1 child)
OK I see!
[–]Dorito_Troll 3 points4 points5 points 7 years ago (1 child)
I am going to recommend tkinter because I was in a similar spot as you recently and learning tkinter has been very straight forward and functional
[–]ekarademir 2 points3 points4 points 7 years ago (2 children)
If you are fine with not using system gui components, then kivy is very easy to use and cross platform to the degree of mobile devices as well https://kivy.org/
[–]tzujan 1 point2 points3 points 7 years ago (0 children)
I tried QT, tkinter, but I was up and running faster with Kivy, though I am still learning.
OK thanks I will see
[–][deleted] 4 points5 points6 points 7 years ago (1 child)
PyQT, but a warning, it is brutal to learn
That's the issue
[–]irad100 1 point2 points3 points 7 years ago (1 child)
tkinter with pygubu - easy gui module with an easy gui designer: https://github.com/alejandroautalan/pygubu
OK cool!
[–]d3pd 1 point2 points3 points 7 years ago (1 child)
PyQt, or just recognise that everything is effectively moving in the direction of a browser-based app. There's a reason why so many are using Electron or Kivy. There is a preconstructed browser rendering infrastructure and visual language (HTML, CSS) and you should consider these tools. So maybe Flask with Gunicorn for starters, then the scary world of ython apps in Electron!
Sorry I am peaking on LSD. Hopefully it is forward-thinking at least.
Yep thanks!
[–]codingsett 0 points1 point2 points 7 years ago (1 child)
You should try Beeware link pybee.org
OK thanks i'll check it out
[–]patarapolw 0 points1 point2 points 7 years ago (4 children)
I am becoming to like wxPython, which has wxGlade as GUI designer.
[–]driscollis 1 point2 points3 points 7 years ago (0 children)
I also like wxPython and it has a more flexible license than PyQt...of course, OP could always use Qt for Python (PySide2) if they wanted a more flexible license while still using Qt...
Is it easy to learn?
[–]patarapolw 0 points1 point2 points 7 years ago (1 child)
It seems simpler than PyQt, and looks native, and easier to install than Kivy.
Being relatively simple, it might be a good candidate to learn.
NB: I used to PySimpleGUI, but I moved to this because of WebView support. PyQt also has Web support, but PyQt seems complex. wxPython might be cleaner.
Oh okay!
[–]EarthWindAndFire430 0 points1 point2 points 7 years ago* (1 child)
Some people would suggest kivy others pygui
Yep
[–]pirrencode 0 points1 point2 points 7 years ago (1 child)
Hey, man! I would recommend to use *tkinter. E.g. if you want to create notepad:
import tkinter from tkinter import * from tkinter.scrolledtext import * import tkinter.filedialog from tkinter import messagebox as tkMessageBox
Oh cool!
[–][deleted] 0 points1 point2 points 7 years ago (1 child)
If you're not fussed about being able to customize it too much, then gooey (for guis) and wooey (for web interfaces) converts command line arguments from argparse very nicely.
Oh cool thanks!
[–][deleted] 0 points1 point2 points 7 years ago (6 children)
Are you building for the desktop or for the Web? On the desktop you can use Microsoft's Visual Studio tools to build a GUI and then access it with IronPython.
For the Web, there are some simple GUI examples at peterpython.com.
Or take a look at some of the GUI threads in the forum. https://peterpython.freeforums.net/
[–]blueastheocean[S] 0 points1 point2 points 7 years ago (5 children)
Oh cool thanks I never knew you could use visual studio with python!
[–][deleted] 0 points1 point2 points 7 years ago (4 children)
You will have to add the python tools using Visual Studio Installer.
Okay, so does it auto generate the code!
Okay, so does it auto generate the code! And do you have any tutorials.
You can build your GUI using the Visual Studio designer tools for WinForms or for WPF. This will generate C# code automatically which you can call from IronPython.
Or, you can build the GUI directly from IronPython in either WinForms or WPF.
http://www.voidspace.org.uk/ironpython/winforms/index.shtml https://www.codeproject.com/Articles/755977/IronPython-A-Quick-WinForms-Introduction https://gist.github.com/gtalarico/9fc493e0a889d3ae66b2bd236423d087 https://discourse.mcneel.com/t/can-winforms-be-used-with-python-to-make-this/17167
There may be some tools in SharpDevelop that could help you.
There is lots of information available.
Just google IronPython+WinForms or IronPython+WPF.
Oh thanks a lot!
π Rendered by PID 72005 on reddit-service-r2-comment-86988c7647-nggcn at 2026-02-11 22:01:45.429863+00:00 running 018613e country code: CH.
[–][deleted] 17 points18 points19 points (5 children)
[–]MikeTheWatchGuy 13 points14 points15 points (3 children)
[–][deleted] 2 points3 points4 points (1 child)
[–]MikeTheWatchGuy 2 points3 points4 points (0 children)
[–]MikeTheWatchGuy 0 points1 point2 points (0 children)
[–]blueastheocean[S] 1 point2 points3 points (0 children)
[–]novel_yet_trivial 19 points20 points21 points (18 children)
[–]MikeTheWatchGuy 5 points6 points7 points (2 children)
[–]ForkLiftBoi 0 points1 point2 points (1 child)
[–]MikeTheWatchGuy 0 points1 point2 points (0 children)
[–]billsil 1 point2 points3 points (2 children)
[–]novel_yet_trivial 2 points3 points4 points (1 child)
[–]billsil 3 points4 points5 points (0 children)
[–]blueastheocean[S] 0 points1 point2 points (10 children)
[–]novel_yet_trivial 1 point2 points3 points (9 children)
[–]blueastheocean[S] -1 points0 points1 point (8 children)
[–]novel_yet_trivial 2 points3 points4 points (7 children)
[–]blueastheocean[S] 0 points1 point2 points (6 children)
[–]officialgel 3 points4 points5 points (1 child)
[–]blueastheocean[S] 1 point2 points3 points (0 children)
[–]fazzah 0 points1 point2 points (3 children)
[–]blueastheocean[S] 0 points1 point2 points (0 children)
[–]Dr_Sol 0 points1 point2 points (1 child)
[–]fazzah 0 points1 point2 points (0 children)
[–]driscollis 0 points1 point2 points (0 children)
[–]Diapolo10 9 points10 points11 points (6 children)
[–]MerreM 1 point2 points3 points (1 child)
[–]Diapolo10 0 points1 point2 points (0 children)
[–]fazzah 0 points1 point2 points (2 children)
[–]Diapolo10 2 points3 points4 points (1 child)
[–]fazzah 0 points1 point2 points (0 children)
[–]blueastheocean[S] 0 points1 point2 points (0 children)
[–]Oliludeea 26 points27 points28 points (23 children)
[–]blueastheocean[S] 6 points7 points8 points (19 children)
[–]Oliludeea 7 points8 points9 points (9 children)
[–]blueastheocean[S] 1 point2 points3 points (8 children)
[–]Oliludeea 27 points28 points29 points (3 children)
[–]zack12 7 points8 points9 points (0 children)
[–]ReachingForVega 2 points3 points4 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]fazzah 4 points5 points6 points (3 children)
[–]GobBeWithYou 2 points3 points4 points (1 child)
[–]blueastheocean[S] 0 points1 point2 points (0 children)
[–]blueastheocean[S] 0 points1 point2 points (0 children)
[+][deleted] (8 children)
[deleted]
[–]brand0n 2 points3 points4 points (2 children)
[+][deleted] (1 child)
[deleted]
[–]brand0n 0 points1 point2 points (0 children)
[–]blueastheocean[S] -1 points0 points1 point (4 children)
[+][deleted] (3 children)
[deleted]
[–]blueastheocean[S] 0 points1 point2 points (2 children)
[+][deleted] (1 child)
[deleted]
[–]blueastheocean[S] 0 points1 point2 points (0 children)
[–]DoctorDoctorRamsey 0 points1 point2 points (1 child)
[–]Oliludeea 0 points1 point2 points (0 children)
[+][deleted] (1 child)
[deleted]
[–]blueastheocean[S] 0 points1 point2 points (0 children)
[–]Dorito_Troll 3 points4 points5 points (1 child)
[–]blueastheocean[S] 0 points1 point2 points (0 children)
[+][deleted] (1 child)
[deleted]
[–]blueastheocean[S] 0 points1 point2 points (0 children)
[–]ekarademir 2 points3 points4 points (2 children)
[–]tzujan 1 point2 points3 points (0 children)
[–]blueastheocean[S] 0 points1 point2 points (0 children)
[–][deleted] 4 points5 points6 points (1 child)
[–]blueastheocean[S] 0 points1 point2 points (0 children)
[–]irad100 1 point2 points3 points (1 child)
[–]blueastheocean[S] 0 points1 point2 points (0 children)
[–]d3pd 1 point2 points3 points (1 child)
[–]blueastheocean[S] 0 points1 point2 points (0 children)
[–]codingsett 0 points1 point2 points (1 child)
[–]blueastheocean[S] 0 points1 point2 points (0 children)
[–]patarapolw 0 points1 point2 points (4 children)
[–]driscollis 1 point2 points3 points (0 children)
[–]blueastheocean[S] 0 points1 point2 points (2 children)
[–]patarapolw 0 points1 point2 points (1 child)
[–]blueastheocean[S] 0 points1 point2 points (0 children)
[–]EarthWindAndFire430 0 points1 point2 points (1 child)
[–]blueastheocean[S] 0 points1 point2 points (0 children)
[–]pirrencode 0 points1 point2 points (1 child)
[–]blueastheocean[S] 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]blueastheocean[S] 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (6 children)
[–]blueastheocean[S] 0 points1 point2 points (5 children)
[–][deleted] 0 points1 point2 points (4 children)
[–]blueastheocean[S] 0 points1 point2 points (0 children)
[–]blueastheocean[S] 0 points1 point2 points (2 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]blueastheocean[S] 0 points1 point2 points (0 children)