mirror of
https://github.com/pyscript/pyscript.git
synced 2026-02-15 04:01:02 -05:00
Merge branch 'main' into poc_ui_blocks
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user