Brython outside of the web -> for GUI with pywebview ... here is a POC

290 views
Skip to first unread message

man atlan

unread,
Jan 7, 2022, 11:52:41 AM1/7/22
to brython
Hi, 

Since I've discovered brython, I can't imagine coding client's part with javascript again.
BTW, I'm always looking for a way to code UI (with python), with html/css technos (see my github repos wuy->guy->gtag) .. and without using electron/cef ;-)

The pywebview is the better option, nowadays ... So i try to mix pywebview & brython, and it's clearly a great option ... here is the simplest poc (proof of concept).

the (py)webview is available on any platforms ... the client side is pure brython, the "server" side (not really "server", because python is not exposed thru http/websocket ... but thru a (pywebview) js_api thing) is pure python. Everything is python3 !

the result is easily freezable (with pyinstaller) ... and should be really easy to port to android too (thru the kivy/pywebview (something like that) )

There is something to explore here ...

(google don't let me include a zip in the post : so it's there )

dgront

unread,
Jan 7, 2022, 2:44:13 PM1/7/22
to bry...@googlegroups.com
Hi!

This is great news! Just one quick point: I haven't found any information on pywebview website whether it can run webassembly. Electron definitely can, and I actually have a plan to port a C++ app with a webgui in Electron.

I still haven't finished a Windows version for my app and the idea to compile it to webasm is really appealing: with a single move I'll build a desktop app for all systems using a C++ code that I already have.

Best,
Dominik Gront



--
You received this message because you are subscribed to the Google Groups "brython" group.
To unsubscribe from this group and stop receiving emails from it, send an email to brython+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/brython/e9307dff-68ac-444e-9909-c9c3f0d4f323n%40googlegroups.com.
Reply all
Reply to author
Forward
Message has been deleted
0 new messages