Merge branch 'main' into poc_ui_blocks

This commit is contained in:
Andrea Giammarchi
2024-04-15 13:51:52 +02:00
committed by GitHub
10 changed files with 326 additions and 334 deletions

View File

@@ -9,28 +9,10 @@
<style>.xterm { padding: .5rem; }</style>
</head>
<body>
<script type="py">
def greetings(event):
print('hello world')
</script>
<script type="mpy" worker terminal>
# works on both worker and main scripts
print("__terminal__", __terminal__)
import sys
from pyscript import display, document
display("Hello", "PyScript Next - PyTerminal", append=False)
print("this should go to the terminal")
print("another line")
# this works as expected
print("this goes to stderr", file=sys.stderr)
document.addEventListener('click', lambda event: print(event.type))
# this works on MicroPython too
print("µpython")
import code
code.interact()
</script>
<button id="my-button" py-click="greetings">Click me</button>
</body>
</html>