No new frontend framework to learn
Vue, React, Svelte, or a hand-written HTML page. If it runs in a browser, it runs in an Axon window.
One window, running Python and a web page side by side — both directions can call methods, read and write properties, and send events.
Building a desktop UI in Python has always been awkward: Qt widgets are slow to draw and slow to change, and using web tech means wiring up a communication layer yourself.
Axon splits it as: Python owns logic and system access, the web page owns the UI, with a bidirectional channel in between.
await Axon.Calc.add(2, 3); Python's add runs and the result comes back to JS.Axon("MainView").DocsJS.render(data); render runs in the page.JS calling Python — define an ordinary method in Python:
from axon import AxonController
@AxonController("MainView")
class Calc:
def add(self, a: int, b: int) -> int:
return a + bCall it from JS:
import { Axon, AxonInit } from "axon-gui";
await AxonInit(); // wait for the channel
const sum = await Axon.Calc.add(2, 3); // 5Python calling JS — expose a plain object in the page:
import { AxonController } from "axon-gui";
AxonController.register("DocsJS", {
mirror(payload) {
return { mirrored: payload, at: Date.now() };
},
});Call it from Python:
from axon import Axon
result = Axon("MainView").DocsJS.mirror({"hello": "world"}).result(5)| What you want to do | Read this |
|---|---|
| Install and open a first window | Quickstart |
| Understand how a message travels | Architecture & message flow |
| Use it as a plain web page only | Dual mode |
| Copy a complete example | Calling Python |
This site ships as a desktop client built with Axon (download). Opened in that client, every example page grows a "Run this example" button that really calls Python and lists what crossed the wire in both directions. Opened in a browser, there are no buttons — just a normal document.