mirror of
https://github.com/pyscript/pyscript.git
synced 2025-12-20 02:37:41 -05:00
* Updated Polyscript with its workers feature * Worked around the inconsistent behavior between Pyodide and MicroPython * Fixed Pyodide greedy access to undesired Proxy fields
20 lines
542 B
Python
20 lines
542 B
Python
from pyscript import document, workers
|
|
|
|
|
|
async def test(interpreter):
|
|
# accessed as item
|
|
named = await workers.micropython_version
|
|
|
|
version = await named.micropython_version()
|
|
document.body.append(version)
|
|
document.body.append(document.createElement("hr"))
|
|
|
|
# accessed as attribute
|
|
named = await workers["pyodide_version"]
|
|
|
|
version = await named.pyodide_version()
|
|
document.body.append(version)
|
|
document.body.append(document.createElement("hr"))
|
|
|
|
document.documentElement.classList.add(interpreter)
|