Skip to main content

PyScript Programming Language

Project description

PyScript

PyScript Logo

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 or 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 syntax makes it 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.

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 interpreter from PyScript releases or from Python Pip with this command (Recommended):

pip install -U pyscript-programming-language

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!

Syntax

Familiar? There it is!

a = float(input("Enter a first number : "))
b = float(input("Enter a second number: "))
op = input("Enter an operation (+, -, *, /): ")

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

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

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

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

default:
print("Unknown operation")
}

Behind it

This language created from based up on a YouTube tutorial (check more on GitHub here). 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.10.1.tar.gz (71.9 kB view details)

Uploaded Source

File details

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

File metadata

File hashes

Hashes for pyscript_programming_language-1.10.1.tar.gz
Algorithm Hash digest
SHA256 7b316a0484172abf2f3938b88d7a7be4e823d933afc5b2d0180a17728483830e
MD5 40a0ab26d39e5dfa8d40b6deeb2442d3
BLAKE2b-256 ad1780dfeb4dcd39c2f0a87c9174a4041df0e8044108421f2204ddf0a24012c5

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