Note: This documentation is still empty or incomplete
PyScript is a simple programming language built on top of Python. It combines some syntax from Python and JavaScript, so if you’re already familiar with Python, JavaScript or both, it should be quite easy to learn.
PyScript may not be the language we’ll be discussing, but the name PyScript already exists, a flexible and platform for running Python in a browser. Since it’s inception, the language was inspired by Python and JavaScript, which are relatively easy for humans to read. This name was chosen because it wasn’t immediately known whether this name was already in use.
This language wasn’t designed to compete with other modern programming languages, but rather as a learning for understanding how programming languages work and how human written code can be understood by machines. Furthermore, this language was created as a relatively complex project. Using Python as the foundation for PyScript, it’s easy to understand how the language is built without having to understand complex instructions like those in C, C++, and other low-level languages.
To learn more about PyScript, you can see on PyScript documentation or PyScript repository for full source code.
First, you’ll need to download Python. Make sure you’re using the latest version above 3.10, to ensure the code runs
correctly. Visit the official Python website to download it.
Next, after downloading and configuring the Python application, you can download the PyScript from PyScript releases or from Python Pip with this command (Recommended):
pip install -U pyscript-programming-language
[OPTIONAL] You can download additional libraries that PyScript requires with this command:
pip install -U "pyscript-programming-language[other]"
And also, you can download PyScript with git:
git clone https://github.com/azzammuhyala/pyscript
cd pyscript
python setup.py install
After that, you can run the PyScript shell (REPL) with this command:
python -m pyscript
If successful, you can see the version, release date, and a >>> like Python shell (REPL).
If you are using the VS Code editor, you can use the PyScript extension for Syntax Highlight!
Expressions
__debug__, True / true, False / false, None / nil / none
/ null, identifier, number, string, tuple, list, dict, set, ...]
(Highest level operations)(<elements>)][<elements>]]{<key>: <value>}]{<elements>}]<target>(<parameters>), <target>[<indexes>],
<target>.<attribute>]<target>++ / ++<target>, <target>-- / --<target>]**]+<target>, -<target>, ~<target>]*, /, //, %, @]+, -]&, |, ^, <<, >>]not <target> / !<target>, ==, !=, ~=, ~!, <,
>, <=, >=]in / ->, not in / !>, is, is not]and / &&, or / ||]??]<condition> ? <valid> : <invalid> /
<valid> if <condition> else <invalid>]typeof <target>] (Lowest level operations):=] (Lowest level operations)Statements
PyScript Library
PyScript Python Packages