Skip to main content

PyScript Programming Language

Project description

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 📖

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.

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 collections.abc required
4 functools required
5 html required
6 importlib required
7 inspect required
8 io required
9 itertools required
10 json required
11 math 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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyscript_programming_language-1.13.3.tar.gz (103.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyscript_programming_language-1.13.3-py3-none-any.whl (115.6 kB view details)

Uploaded Python 3

File details

Details for the file pyscript_programming_language-1.13.3.tar.gz.

File metadata

File hashes

Hashes for pyscript_programming_language-1.13.3.tar.gz
Algorithm Hash digest
SHA256 7eedcf0a921d36b538ecb77b2640bb95d4e56dd5d1e904feac88df26974b7a12
MD5 c23a75b69015369ed2b5e71e1fad23b7
BLAKE2b-256 92c77dfa6dc61b8073fb0f542ad0d149a28b25fecd5e8647deaab225b47a0427

See more details on using hashes here.

File details

Details for the file pyscript_programming_language-1.13.3-py3-none-any.whl.

File metadata

File hashes

Hashes for pyscript_programming_language-1.13.3-py3-none-any.whl
Algorithm Hash digest
SHA256 6f7a7e0e4d554d137da9ae31415bbbe61afd4a6c97f64f3f9a1ab58b19adbeb2
MD5 006e00f571d3e327b9808f20c3693b2e
BLAKE2b-256 28dc2d92b4b0600695c59f9a837f6be2e9c367d34b6a9d2b786270ca327bf5c7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page