Skip to content

Instantly share code, notes, and snippets.

@huaxlin
Last active May 24, 2023 01:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save huaxlin/37bcc679ea2f1c7a158c2c1de4412a3b to your computer and use it in GitHub Desktop.
Save huaxlin/37bcc679ea2f1c7a158c2c1de4412a3b to your computer and use it in GitHub Desktop.
<html>
<head>
<script defer src="https://pyscript.net/latest/pyscript.js"></script>
</head>
<body>
<div id="output"></div>
<py-script>
import asyncio
async def main():
output = Element("output")
while True:
await asyncio.sleep(0.5)
output.element.innerText = "Hello PyScript in WebAssembly"
await asyncio.sleep(0.5)
output.element.innerText = ""
asyncio.ensure_future(main())
</py-script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment