As of PyScript 2022.09.1 that released on Friday, print() is sent to the Developer console by default instead of to the screen. So if you’re linking to https://pyscript.net/latest/pyscript.js that’s what you’ll see today:
The fact that you see the last printed thing, e, is a byproduct of the fact that by default, the Pyodide function that’s used under hood to evaluate the Python code returns the value of the last expression in the source code which is then output to the screen.
You might notice that there’s one line in the Developer Console per argument to print(), as apposed to one per line like you might expect. This is a known issue - in short, there’s one line in the console per write to stdout, and print() sends each of its arguments to stdout separately.
Thank you!
I got it.
I found another way in your providing link.
below script can print all data.
‐---------
import js.jQuery as jp
jp(‘py-repl’).last().append(‘’)
output = Element(‘output’)
for i, j in enumerate(‘abcde’):
output.element.append(str(i) + ‘-’ + j + ', ')