Hacker Newsnew | past | comments | ask | show | jobs | submit | rodja's commentslogin

pywebview (https://github.com/r0x0r/pywebview) is an excellent suggestion and is already being used in NiceGUI to create a native desktop window with "native=True" option (see http://127.0.0.1:8080/documentation#ui_run).


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).


Very cool!


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.

We maintain a slot stack (https://github.com/zauberzeug/nicegui/blob/main/nicegui/slot...) to keep track of the current context (see http://127.0.0.1:8080/documentation#auto-context). When creating a new element, it finds its parent slot on the slot stack (https://github.com/zauberzeug/nicegui/blob/main/nicegui/elem...).

What do you think. Does it make sense? We appreciate your feedback!


> Hi Ken_At_EM […] see http://127.0.0.1:8080

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


I summarized my thoughts on this about two month ago on Reddit (https://www.reddit.com/r/Python/comments/10h6l7e/comment/j5x...). Here the recap:

- 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).


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: