API: Python Terminal (r1)
This API supports
Python
in the browser.
The World is pure Python (no JavaScript).
PyScript with fast compiler and Terminal:
This API works as follows:
- The code is pure Python.
- At run-time the Python code is interpreted by PyScript and run.
-
The Python code is syntax highlighted.
It is not syntax checked.
We do not have Python syntax checking yet.
- You can use await input() to read input from the user.
- print() outputs to the Terminal.
For help on how to use Python in the Pyscript environment, see:
This API has further features:
Screenshots:
- The screenshot does not assume there is a canvas. Instead it takes a screenshot of the HTML.
- It uses the
html2canvas
library
to build a screenshot of your page using JS.
-
The html2canvas library has some
limitations
and may not be able to accurately screenshot your page.
The underlying file type is .js:
- The basic design of this site is for .js files.
And there are issues with .py files on the server.
So we simply leave the underlying file type as .js, which is safe.
So even though there is no JS code and it is pure Python, underneath the file type is .js.
It does not matter and you will not normally notice.
Templates