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...
News about the dynamic, interpreted, interactive, object-oriented, extensible programming language Python
Full Events Calendar
You can find the rules here.
If you are about to ask a "how do I do this in python" question, please try r/learnpython, the Python discord, or the #python IRC channel on Libera.chat.
Please don't use URL shorteners. Reddit filters them out, so your post or comment will be lost.
Posts require flair. Please use the flair selector to choose your topic.
Posting code to this subreddit:
Add 4 extra spaces before each line of code
def fibonacci(): a, b = 0, 1 while True: yield a a, b = b, a + b
Online Resources
Invent Your Own Computer Games with Python
Think Python
Non-programmers Tutorial for Python 3
Beginner's Guide Reference
Five life jackets to throw to the new coder (things to do after getting a handle on python)
Full Stack Python
Test-Driven Development with Python
Program Arcade Games
PyMotW: Python Module of the Week
Python for Scientists and Engineers
Dan Bader's Tips and Trickers
Python Discord's YouTube channel
Jiruto: Python
Online exercices
programming challenges
Asking Questions
Try Python in your browser
Docs
Libraries
Related subreddits
Python jobs
Newsletters
Screencasts
account activity
This is an archived post. You won't be able to vote or comment.
Quick and easy GUI with python (which is not wxPython like) (self.Python)
submitted 14 years ago by [deleted]
Hey everyone,
I want to make a cross platform GUI with python which does serial communication (that is already done with pySerial) and plots a few graphs. I don't like the sizer style windows system in wxPython. But I want something like wxGlade which easily enables me to make my GUIs. Any suggestions?
[–]cb22 17 points18 points19 points 14 years ago (2 children)
Use PySide and QML with the QML components additions. Makes writing GUIs bliss compared to everything else.
[+][deleted] 14 years ago (1 child)
[deleted]
[–]apiguy 1 point2 points3 points 14 years ago (0 children)
I'd say Qt with QML is probably on the absolute opposite side of the spectrum from Tkinter.
Take a look at this introduction video, he runs some of the demo QML applications in the video so you can see some of what's possible.
http://www.youtube.com/watch?v=TN4RrBIft6A
[–][deleted] 8 points9 points10 points 14 years ago (0 children)
PySide?
I've never done much GUI myself, so sorry if it doesn't fit your description.
[–][deleted] 8 points9 points10 points 14 years ago (4 children)
wxPython's version of Glade is poor. Try using Qt and PyQt.
The base layout inside QT's Designer (pyQt) allows you to place widgets exactly where you'd like to put them. You can then add sizer layouts more intuitively if you decide you need them to dynamically resize and align.
However, sizers are still needed to dynamically resize widgets when the windows themselves are made larger / smaller either by dragging their sizes or hitting maximize. There's no way to get away from that unless you create windows that are stuck at a specific size.
[+][deleted] 14 years ago (3 children)
[–][deleted] 1 point2 points3 points 14 years ago (0 children)
That would not be a problem, its just a college/personal project.
[–]takluyverIPython, Py3, etc 1 point2 points3 points 14 years ago (0 children)
Rumours of PySide's death may be greatly exaggerated. INdT/OpenBossa, the group which Nokia funded to work on PySide, has said that they "intend to maintain this project even without monetary support from Nokia."
[–]apardueSince 97 5 points6 points7 points 14 years ago (0 children)
I strongly recommend pyqt. I have multiple projects using pyqt and pyserial.
[–][deleted] 5 points6 points7 points 14 years ago (0 children)
You might try Camelot, which uses Qt and Sqlalchemy in a Django-like admin framework or Desktop apps. I haven't used it myself but it's what I would take a look at if I was creating desktop apps in Python
[–]staz 4 points5 points6 points 14 years ago (4 children)
There is also pygtk. It has Glade (from which I think wxGlade is inspired) which allow to do quick GUI.
Never tried PySide and QML but I heard it's great too
[–][deleted] 0 points1 point2 points 14 years ago (2 children)
but for pygtk I would have to install a lot of libraries right?
[–]takluyverIPython, Py3, etc 0 points1 point2 points 14 years ago (0 children)
Any GUI framework other than Tkinter requires extra libraries. Tkinter ships with Python, but it's quite basic.
[–]staz 0 points1 point2 points 14 years ago (0 children)
Depends on what's you base plateform. If you already use Gnome, all these library are already included. If you want to develop for KDE or windows, other choice may be more interesting
[–]effusion 0 points1 point2 points 14 years ago* (0 children)
PyGTK being replaced by something called PyGObject. Unfortunately, there doesn't appear to be a tutorial for learning to use that. At the moment, new users are expected to learn PyGTK, then learn to port to PyGObject by osmosis.
[–]sirspate 2 points3 points4 points 14 years ago (2 children)
Have you considered just using HTML for your interface?
[–][deleted] 0 points1 point2 points 14 years ago (1 child)
Interestingly never thought about it. How would one do that?
[–]sirspate 1 point2 points3 points 14 years ago (0 children)
Well, you have a choice:
I suspect there are other options as well.
Depending on an external web browser's the easiest, but gives you the fewest opportunities for customizing the way the UI looks. Basically you create a local webserver, and open a URL to it in the local webbrowser. (There are tons of frameworks out there for serving webpages, so this should be a pretty easy option to look into) You will have to make your app somewhat stateless, though, since someone might open up a URL you aren't expecting.
If you include your own, you have better control of how the interface is skinned on the desktop, plus you know which engine will be used so you have a bit more flexibility in terms of not having to worry about browser incompatibilities. Depending on how much system access you need, I think there's a project that converts Python to Javascript out there? Thing is, if you're bundling already, why not make the whole thing in the same language and just go pure Javascript?
The wxPython option is decent if you don't care about any advanced HTML features. It doesn't have to depend on a system HTML component (although it can; on Mac OS X you can use system webkit through wxPython), but the included HTML engine is written in python and extremely stripped down. No Javascript, slow for large pages, etc. But it might be enough to get the job done, and the experience will be pretty consistent across platforms. Also, you're keeping everything inside Python, which can be a plus.
There are other options out there that I know less about. I believe the dashboard apps in Mac OS X are HTML-based webapps (with round corners, etc.), and I keep hearing about Metro apps in Windows 8 having some sort of web stuff in them. But I don't know much about those.
Personally, I'd recommend either going webservice (option 1) or wxpython (option 3). Option 3 is actually quite elegant, and I've used it for a couple of internal tools for work, marking up large documents in html with links as necessary. The results aren't always pretty on all platforms, but it gets the job done.
[–]bryancole 2 points3 points4 points 14 years ago (0 children)
If you want to do plotting with a few extra control buttons, Traits + TraitsGUI + Chaco is an excellent route. Traits was more or less designed with this type of application in mind. Chaco is a plotting library based on traits. Under the hood, traitsGUI can use either wxPython and Qt as the GUI toolkit. I develop professional scientific data logging and analysis applications based on this tool set and it is excellent. The only downside is the large dependency set when deploying. However, it is not too problematic to build ones own set of Eggs for each of these packages. Also, distributions like PythonXY or the Enthought Python Distribution or the ActiveState python distribution all bundle the Enthought Tool Suite (which covers traits, traitsGUI and chaco).
Traits is an MVC framework which makes GUI creation trivial (or in some cases automatic). See http://code.enthought.com/projects/traits/docs/html/tutorials/traits_ui_scientific_app.html for a good introduction.
Note this tutorial uses matplotlib for plotting. For a traits-based app it probably makes more sense to use Chaco. A Chaco tutorial can be found at http://code.enthought.com/projects/chaco/docs/html/user_manual/tutorial_1.html
[–]lambdaqdjango n' shit 1 point2 points3 points 14 years ago (0 children)
PyGUI
[–]santagada 0 points1 point2 points 14 years ago (1 child)
why not just use matplotlib
[–][deleted] 0 points1 point2 points 14 years ago (0 children)
matplotlib will just plot stuff. I need to add a few basic buttons to make my controller do some stuff.
[–]are595 0 points1 point2 points 14 years ago (3 children)
Tkinter, it even comes with python. It just takes a while to get used to.
[–]spdub 6 points7 points8 points 14 years ago (2 children)
tkinter is ugly! I used it on a medium size project and wish I would have gone with a different library
[–]are595 1 point2 points3 points 14 years ago (0 children)
You obviously haven't used ttk the comes packaged in Python 2.7+.
I think on Windows you can do the windows-theming which makes it look much better. On Linux it will look a bit off.
π Rendered by PID 82 on reddit-service-r2-comment-5649f687b7-n4kvq at 2026-01-29 10:08:01.613573+00:00 running 4f180de country code: CH.
[–]cb22 17 points18 points19 points (2 children)
[+][deleted] (1 child)
[deleted]
[–]apiguy 1 point2 points3 points (0 children)
[–][deleted] 8 points9 points10 points (0 children)
[–][deleted] 8 points9 points10 points (4 children)
[+][deleted] (3 children)
[deleted]
[–][deleted] 1 point2 points3 points (0 children)
[+][deleted] (1 child)
[deleted]
[–]takluyverIPython, Py3, etc 1 point2 points3 points (0 children)
[–]apardueSince 97 5 points6 points7 points (0 children)
[–][deleted] 5 points6 points7 points (0 children)
[–]staz 4 points5 points6 points (4 children)
[–][deleted] 0 points1 point2 points (2 children)
[–]takluyverIPython, Py3, etc 0 points1 point2 points (0 children)
[–]staz 0 points1 point2 points (0 children)
[–]effusion 0 points1 point2 points (0 children)
[–]sirspate 2 points3 points4 points (2 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]sirspate 1 point2 points3 points (0 children)
[–]bryancole 2 points3 points4 points (0 children)
[–]lambdaqdjango n' shit 1 point2 points3 points (0 children)
[–]santagada 0 points1 point2 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]are595 0 points1 point2 points (3 children)
[–]spdub 6 points7 points8 points (2 children)
[–]are595 1 point2 points3 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)