Is There a Python GUI Framework Based on The Elm Architecture?

0
0
Asked By MellowPine42 On

I've been enjoying Rust's `iced` and its use of The Elm Architecture, so I'm looking for something similar in Python. Ideally, it would provide a Model/Update/View structure with message passing instead of wiring UI controls directly to callbacks. Are there any existing Python implementations or GUI libraries that follow this pattern? I was considering building a wrapper around Tkinter, but I'd rather use an existing project if one is available.

3 Answers

Answered By CedarFox7 On

There may be small Python projects that implement a fairly faithful Elm Architecture pattern—model, update, view, and message passing—but Python doesn't currently seem to have a widely adopted native equivalent to `iced`. Most Python GUI toolkits are still primarily callback- and event-driven.

MellowPine42 -

Do you know the name or location of one of those projects? I haven't been able to find a reliable implementation.

Answered By QuietMaple6 On

Tkinter is available in the standard library, but using it doesn't automatically give you an Elm-style design. In a TEA approach, a button emits a message, the central `update()` function changes the model based on that message, and `view()` renders the interface from the current model. You'd need to build that message loop and rendering structure yourself around the toolkit.

OrbitingWren31 -

Exactly—the question is about the architecture, not just which GUI toolkit to use. The important difference is replacing direct button callbacks with messages handled centrally by `update()`.

Answered By BrightHarbor19 On

For a serious desktop application, I'd look at PySide or PyQt rather than Tkinter. They're more capable and polished, although you'd still need to layer your own TEA-style architecture on top instead of getting it built in.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.