ui = {
brython
return html`
<script type="text/python">
# problem: after refreshing this cell (Shift+ENTER) - executing a Python script stops. Next brythonVer should be refreshed (or all page [F5]).
print('\\n PRINT: ok') # '\\n - inside html cell
print('\\n __BRYTHON__.__MAGIC__ ',__BRYTHON__.__MAGIC__,'\\n------\\n')
from browser import document #, alert() - doesn't work - unimportant.
def echo(ev):
s = document["zone"].value
document["echo2"].text = f'Hello - {s} !'
print(f'Hello {s} !')
btn = document["test"]; btn.unbind("click") # unbind, so re-evaluating this cell will be OK
btn.bind("click", echo)
</script>
<p>Your name is : <input id="zone" autocomplete="off" value="Test 0">
<button id="test">click !</button> <span id="echo2"><span>
`}