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):
frombeepyimportTag, mount, state, onclassIncrementButton(Tag, name='button'):
count=state(0)
@ondefclick(self):
self.count+=1defcontent(self):
returnf'Count: {self.count}'mount(IncrementButton(), '#root')will render html as below, and will react on buttons click like native JS
<body><divid="root"><button><div>Count: 5</div></button></div></body>