We understand the need for a solid Electron-like solution with a Python backend and good deployment tools, and that's where NiceGUI aims to fill the gap with it's 1.2 release (https://news.ycombinator.com/item?id=35386990).
Hi Ken_At_EM, thanks for looking into our code! Our approach with context managers for defining "belonging" in NiceGUI resembles the nesting of elements in HTML. By implementing the __enter__ and __exit__ methods, we can manage the context when used with a "with" expression. In NiceGUI, elements pass down to the default_slot (https://github.com/zauberzeug/nicegui/blob/main/nicegui/elem...), which is a 1:1 representation of Vue slots.
Maybe imperative UI declaration needs a little extra care to keep its state consistent after all :D
Please take my silly glib response as a friendly jab not a meanspirited one… but this made me chuckle a couple times! Good luck with your project nonetheless
- NiceGUI was initially build for accessing and controlling hardware as shown in our webcam demo); I'm not sure how it would be done with Pynecone
- NiceGUI encourages the use of standard Python (callbacks, if-statements,..), Pynecone on the other hand uses explicit State classes and provides constructs like pc.cond and pc.foreach.
- NiceGUI uses Vue/Quasar for the frontend while Pynecone is build on NextJS
- NiceGUI generates HTML/JS/CSS via templates on the fly while Pynceone has an explicit compile step; so NiceGUI can be run with normal "Python" instead of using a command like "pc"
- while both frameworks use FastAPI for the backend, in NiceGUI you can actually use your own App and simply extend it with NiceGUI to provide additional UI; Pynecone hides FastAPI which makes it harder to provide other API endpoints (for example to serve images from memory instead of files).