Curious to know what you're using under the hood for the python! I've download the repo and a quick search with "pyodide" didn't return anything.
Is python actually executed in the browser or is there a cpython process running on the backend?
Rio: Web apps in pure Python
21–30 of 205 posts
Re: Rio: Web apps in pure Python
#22Is it the run_in_window() method cross platform? Can you talk a bit more about the implementation?
Re: Rio: Web apps in pure Python
#23This kind "you don't need JavaScript, HTML and CSS" approach always fails flat. We already went down this route several times since the first dotcom wave and all the frameworks that tried to target the browser as if we don't need to know "JavaScript, HTML and CSS". Until we need to debug the application, or why it isn't rendering as it should. It is also why I am not a big fan of Blazor, even though I admire its engi…
Re: Rio: Web apps in pure Python
#24I swear, HTML/CSS + Flask + HTMX gets you so far these days. Then, you can throw in some AlpineJS for any inter-element interaction you need and build a responsive SPA without almost any JavaScript.
Re: Rio: Web apps in pure Python
#25The primary advantage is that the built in set of components is pretty powerful (e.g. a real table view), everything runs server side, the Python can be JIT compiled, and from the user's POV it still feels like a web app (e.g. zoom is respected). You can "shell out" to Javascript if needed, you can use Java libraries. The JPro website is itself a JavaFX app running as a web app. Also there's a visual UI builder that's decent (and free).
Primary downside beyond just the obscurity of the stack (same problem as for Rio), is just that JPro is a commercial solution. But then you get commercial support and bug fixes in case you need something special or hit an obscure rendering case.
Re: Rio: Web apps in pure Python
#26This kind "you don't need JavaScript, HTML and CSS" approach always fails flat. We already went down this route several times since the first dotcom wave and all the frameworks that tried to target the browser as if we don't need to know "JavaScript, HTML and CSS". Until we need to debug the application, or why it isn't rendering as it should. It is also why I am not a big fan of Blazor, even though I admire its engi…
For example, here's an excerpt of what the built-in dev-tools have to say about a button in one of my apps:
> The component was allocated a width of 104.0 by its parent MyRoot. Due to align_x being set, the Button only takes up the minimum amount of space necessary and is centered in the available space.
Re: Rio: Web apps in pure Python
#27These frameworks are cute, and I understand the desire to avoid the modern SPA JavaScript build systems, but it always seems like so much more work than just writing HTML. I swear, HTML/CSS + Flask + HTMX gets you so far these days. Then, you can throw in some AlpineJS for any inter-element interaction you need and build a responsive SPA without almost any JavaScript.
We've been getting a lot of reactions from people being surprised how quickly they can create Rio apps after just a few hours, when previously creating UIs was always a major roadblock for them. Seeing these reactions has been extremely rewarding.
Re: Rio: Web apps in pure Python
#28Looks like htpy, but with some components and a different syntax? https://htpy.dev/
Re: Rio: Web apps in pure Python
#29Re: Rio: Web apps in pure Python
#30Is it the run_in_window() method cross platform? Can you talk a bit more about the implementation?
afaict it uses https://github.com/r0x0r/pywebview under the hood (so yes, cross-platform)
Local apps run inside of a webview. Think of it like electron but for Python. Even though this _should_ be cross platform, we've unfortunately found a lot of subtle issues with pywebview. That's why we're still considering this to be experimental.
In my experience webview works great on Windows, but struggles on Linux. For examples Videos don't play reliably when using the GTK backend.
We're looking into other ways to run a browser - my favorite would be to just find one already installed and just start it without UI - but that's some way off.