Skip to main content

PyScript

PyScript is a 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.

Introduction 📖

The name of "PyScript" was previously used by a well-known framework designed to run Python directly in the browser. Designed from the outset with inspiration from both Python and JavaScript, this language emphasizes human readability. Its name was derived by combining Python and JavaScript. Please note that this language is an independent programming language project written in Python and has no affiliation with the aforementioned PyScript framework.

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.

Try PyScript ▶️

Try PyScript Shell (REPL) inside your browser directly (no installation required).

Installation ⬇️

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 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
pip 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).

Example 📜

Familiar? There it is!

# get a number and operator with input()
a = float(input("Enter a first number : "))
b = float(input("Enter a second number: "))
operation = input("Enter an operation (+, -, *, /): ")

# define a functions
func add(a, b) {
return a + b
}

func sub(a, b) {
return a - b
}

func mul(a, b) {
return a * b
}

func floordiv(a, b) {
# check b is zero
return b != 0 ? a / b : none
}

# operation matching
switch (operation.strip())
{
case '+':
result = add(a, b)
print("Result of {:,} + {:,} = {:,}".format(a, b, result))
break

case '-':
result = sub(a, b)
print("Result of {:,} - {:,} = {:,}".format(a, b, result))
break

case '*':
result = mul(a, b)
print("Result of {:,} * {:,} = {:,}".format(a, b, result))
break

case '/':
result = floordiv(a, b)
print("Result of {:,} / {:,} = {}".format(
a, b,
result is not none ? format(result, ',') : "Cannot be divided by 0")
)
break

default:
print("Unknown operation")
}

Library Requirements 📓

No Name Status
1 argparse required
2 builtins required
3 cmath required
4 collections.abc required
5 functools required
6 html required
7 importlib required
8 inspect required
9 io required
10 itertools required
11 json required
12 operator required
13 os required
14 re required
15 subprocess required
16 sys required
17 threading required
18 types required
19 typing required
20 unicodedata required
1 ast required (library)
2 msvcrt required (library)
3 pprint required (library)
4 shutil required (library)
5 stat required (library)
6 termios required (library)
7 time required (library)
8 tty required (library)
1 beartype optional
2 prompt_toolkit optional
3 pygments optional
4 readline optional
5 tkinter optional
6 IPython optional

Status Explanation

  • required: Required by PyScript entirely.
  • required (library): Required PyScript library (located in pyscript/lib). PyScript is not affected unless you import it.
  • optional: Not required, but if it is present, some features can be used without issue.

Highlights 🎨

Behind It 🕰️

This language created from based up on a YouTube tutorial (check more on GitHub here by @davidcallanan). At least, it takes about 6 months to learn it, and also need to learn general things that exist in other programming languages.

Metadata

Release files for pyscript-programming-language 1.13.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyscript-programming-language 1.13.4
File Size Uploaded
pyscript_programming_language-1.13.4.tar.gz 104.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyscript-programming-language 1.13.4
File Interpreter ABI Platform
pyscript_programming_language-1.13.4-py3-none-any.whl Python 3 none any Details

Total release size: 220.9 kB

Release files / pyscript_programming_language-1.13.4.tar.gz

Download URL pyscript_programming_language-1.13.4.tar.gz
Size 104.7 kB
Tags Source
SHA-256 checksum
How to use checksums
03e0b805cc0fe939074c2b36557e7ad17fe50050a264af9e5f4a6c48fdb5f25f
BLAKE2b-256 checksum
How to use checksums
98b6566af6aba12f65515f45f2fd0d4d43f1cd626f8fecc1d0c4cc4db8f6bbf6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.0

Release files / pyscript_programming_language-1.13.4-py3-none-any.whl

Download URL pyscript_programming_language-1.13.4-py3-none-any.whl
Size 116.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5001cc73a7c4b9a311260bc480ddcd34206de859db150beaea1d67b6206b5ec4
BLAKE2b-256 checksum
How to use checksums
20d1bb1b05a0e9f317daf2b2806855d4b82d45a512c2415875f4291aab9ee950
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.0

Release history Release notifications | RSS feed

This release

1.13.4 This release

2 release files

1.13.3

2 release files

1.13.2

2 release files

1.13.1

2 release files

1.13.0

2 release files

1.12.9

2 release files

1.12.8

2 release files

1.12.7

2 release files

1.12.6

2 release files

1.12.5

2 release files

1.12.2

2 release files

1.12.1

2 release files

1.12.0

2 release files

1.11.3

1 release file

1.11.2

1 release file

1.11.1

1 release file

1.11.0

1 release file

1.10.4

1 release file

1.10.3

1 release file

1.10.2

1 release file

1.10.1

1 release file

1.10.0

1 release file

1.9.0

1 release file

1.8.1

1 release file

1.8.0

1 release file

1.7.3

1 release file

1.7.2

1 release file

1.7.1

1 release file

1.7.0

1 release file

1.6.1

1 release file

1.6.0

1 release file

1.5.1

1 release file

1.5.0

1 release file

1.4.0

1 release file

1.3.1

1 release file

1.3.0

1 release file

1.2.3

1 release file

1.2.2

1 release file

1.2.1

1 release file

1.2.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page