Last active
May 24, 2023 01:42
-
-
Save huaxlin/37bcc679ea2f1c7a158c2c1de4412a3b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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