Thanks for Pyodide - port of Python to Emscripten, based on WASM.
Try it out! CodeSandBox and BeePy Sandbox
Join our community at Telegram chat
Documentation | PyPI | NPM
Code (custom_url.py from examples):
from beepy import Tag, mount, state, on
class IncrementButton(Tag, name='button'):
count = state(0)
@on
def click(self):
self.count += 1
def content(self):
return f'Count: {self.count}'
mount(IncrementButton(), '#root')
will render html as below, and will react on buttons click like native JS
<body>
<div id="root">
<button>
<div>Count: 5</div>
</button>
</div>
</body>