6 ms·
Python GUIs for Humans – Transforms UI into People-Friendly Pythonic Interfaces
- 41209 5y agoVery very neat. I might use this the next time I need to build out a small personal project. I've taken a rather strong liking to Python recently. So much is built into the standard library compared to NodeJS. Very useful for quick projects/ AWS lambdas where installing dependencies is a pain. Do you have a good guide on wrapping this in a binary ? Wouldn't be able to use it in a corporate environment though, the licensing isn't great for that.
- hexadec 5y agoThis is an incredible project I had never even heard of before. This is what github/lab projects should be in my opinion. An incredible solution, well documented, with exceptional examples. I got the intent and was up and running in less than an hour. Great functionality as well in terms of simplifying layout and portability.
- pryelluw 5y agoI’ve used this to build stuff of various complexity and it works well. The docs are good.
- semireg 5y agoDoes this kind of app distribute easily? As in, can I package up the runtime and the app into a single exe? I see this, but does someone have experience to share? Edit: Found it! https://github.com/PySimpleGUI/PySimpleGUI/blob/master/docs/cookbook.md#creating-a-windows-exe-file https://github.com/PySimpleGUI/PySimpleGUI/blob/master/docs/...
- moondev 5y agoI suppose if targeting the web backend you could package into a docker container. I wonder if golang embed could be an option for packing python for native ui
- dagw 5y agoAnother option to look into is Nuitka. I haven't tested it with PySimpleGUI, but I've used it to package wxPython apps for windows in the past and it worked really well.
- analog31 5y agoI like the concept a lot, having written my own "wrapper" for Tkinter and wishing I could adapt it to Remi. My only thought is that defining the contents of a layout as a dict instead of a list, would allow the elements to be referenced by a name rather than number. That would make it easier to read and modify one's own code.
- H8crilA 5y agoDict() is unordered.
- rmellow 5y agoAs of Python 3.6, Dictionaries are ordered.
- H8crilA 5y agoUh, nice, didn't know. That will fix a lot of bad (nondeterministic) code out there :)
- smarnach 5y agoIt's actually as of Python (the language) 3.7. The CPython implementation of Python 3.6 already has ordered dicts as an implementation detail, but it's not part of the language in that version.
- maicro 5y agoFrom Example 2 (https://github.com/PySimpleGUI/PySimpleGUI#example-2---interactive-window https://github.com/PySimpleGUI/PySimpleGUI#example-2---inter... ) it looks like you can assign names to layout elements with "key".
- Raineer 5y agoJust finished up a Python class as part of my EE this summer. I had no idea this wasn't the default way everyone did Python GUIs. This was the main library we used throughout - it was very approachable and easy to configure.
- mtoohig 5y agoI've also found this project to be very good. I used it for a personal project to help me manually tag images and prepare a payload to upload to a remote server's database. Some of their naming conventions though are odd IMO but otherwise I thought it was an easier way to process images than a webapp which is my usual working area. Now that I think of it though, a juniper notebook may have also been a solution but I wanted to dabble with writing a GUI.
- KingMachiavelli 5y agoIs there something like this but creates a simple web app?
- analog31 5y agoTo make it run entirely in the user's browser, you need to have the Python interpreter and any additional libraries running on the user's machine. This is the case with Javascript but not Python.
- dagw 5y agoAnvil (https://anvil.works/ https://anvil.works/) is probably the closest thing to what you are looking for, at least in the python world.
- Uberphallus 5y agoThis actually has a web backend.
- nyellin 5y agoSee https://streamlit.io/ https://streamlit.io/
- johnne86sd 5y agoCheck out https://www.pyweb.io/ https://www.pyweb.io/
- GeorgeTirebiter 5y agolook at https://pywebio.readthedocs.io/en/latest/ https://pywebio.readthedocs.io/en/latest/
- arpafaucon 5y agoKudos to the writer! I used this framework for an small robotics project and, as others pointed out, I was up and running in less than an hour. However, as the project grew more complex, I reached a point where I felt the framework was in the way: I wanted complex things, and lacked the means to configure the framework that precisely. I would recommend others to keep the framework for what it does so incredibly well : small / prototypes projects ; but do not hesitate to switch to a more powerful backend once you feel your needs are complexifying.
- KeplerBoy 5y agoWhat solution did you end up switching to? I have a feeling that most python GUIs are lacking in some area and for full creative freedom someone would have to go for flask or fastapi, build the UI with modern js-frontend frameworks and connect that frontend with the actual application using websockets or regular HTTP-Requests.
- simonh 5y agoI’ve had great success using PyQt for quite sophisticated GUIs. Any of the native bindings should give good results too. I doubt JS would give you more flexibility and performance than these.
- scarygliders 5y agoI've been very happy with using Qt and PySide and now PySide2. Without it I couldn't have produced Captain's Log, for example : https://captainslog.scarygliders.net/captains-log-2/ https://captainslog.scarygliders.net/captains-log-2/
- barnabee 5y agoI have found DearPyGui [1] to be a really efficient way to knock up a quick GUI for a Python script/app. There's almost no boilerplate and I've found it scales reasonably well as things get more complex as it's easy to split views/"components" into modules and classes. [1] https://github.com/hoffstadt/DearPyGui https://github.com/hoffstadt/DearPyGui
- 5y ago
- Barrin92 5y agoI really like the "interface layout as a list of lists" idea. It's kind of like a LISP 'code is data' paradigm but for guis
- wraptile 5y agoI used PySimpleGUI in a devops app that used the new tables widget (only on tkinter) to track/resolve/debug issues (i.e. domain specific sentry). It worked really well! The whole codebase was 300 loc: pull issues from api, put them into table rows, filter rows by combobox filters and handle button presses. Unfortunately as the app grew the main loop became really hard to follow and I've started to miss callbacks or some sort of oop wrapper around the whole thing. I also noticed that any other backend than TKinter was more like a 3rd class citizen rather than an alternative. Other than that it's probably the best GUI programming entrypoint in Python!
- frederikvs 5y agoFor those looking to build a simple GUI, another option is Gooey [0]. It takes your arparse declarations and builds a simple GUI based on that. Gooey is probably easier to set up, but PySimpleGUI looks like it's more flexible and powerful. Look at your own battle and choose your weapons accordingly :-) [0] https://github.com/chriskiehl/Gooey https://github.com/chriskiehl/Gooey
- leoncvlt 5y agoCame here to mention this, Gooey is very useful to make simple command-line scripts "non-tech-friendly" by giving it a familiar GUI rather than a scary black terminal window :)
- amelius 5y agoThe example code almost looks like HTML ...
- mdtrooper 5y agoOne question. Which is the best python library for TUI? I used to use http://urwid.org/ http://urwid.org/ but It needs a lot of code to do the stuffs. I look for a library that is packaged in Debian (if something is in Debian, it is standard and has long life).
- jimnotgym 5y agoI can't help but love projects like this. I used to write simple apps that took a simple input and did a thing... and it seems so unintuitive compared to VisualBasic, for instance, even allowing for defining windows programmatically.
- phil294 5y agoDoes anyone know how this compares to guietta? [1] Both look quite similar, and I have already successfully used the latter in two small projects. It was so easy to set up, I had not even have to read much of the documentation at all. Edit: I have found the answer in the docs [2] [1] https://github.com/alfiopuglisi/guietta/ https://github.com/alfiopuglisi/guietta/ [2] https://guietta.readthedocs.io/en/latest/intro.html#aren-t-you-just-copying-from-pysimplegui https://guietta.readthedocs.io/en/latest/intro.html#aren-t-y...
- s_gourichon 5y agoUsed Guietta for a small project. Looked simpler to code and to "package". Nice you mention it.
- thecal 5y agoI've used this library twice, it is fantastic when you need a simple GUI on top of a Python script. Congrats for being on the front page of HN!
- cafard 5y agoInteresting. PythonCard used to be a very handy tool, built on top of wxPython, but it was abandoned some years ago.
- brian_herman 5y agoI've used pysimplegui at work it is a great framework to get up and working for a simple gui. It took me 30 minutes to code the gui and I sent it to our underwriting department to help them deal with a bug we were having with our system.
- mwexler 5y agoProps for the best readme I've seen on GH in a long, long time.
- naomeux 5y agoThe code looks readable. This needs to be exposed, it's quite easy, and it seems interactive.
- GeorgeTirebiter 5y agoI wrote a pretty fancy GUI for a real-time system (was handled by MPUs externally, so no real-time in GUI). I found it to be fairly easy to use; there are plenty of examples, and often you can mix-and-match from the examples to get what you want. It's also true that as you want fancier interactions, you have to be clever to get the framework to do what you want. It's very good --- best easy-to-use Python GUI I'd say --- but it won't handle every fancy GUI requirement. (That's why you have PyQt etc)