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.4.tar.gz (72.5 kB view details)

Uploaded Source

File details

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

File metadata

File hashes

Hashes for pyscript_programming_language-1.10.4.tar.gz
Algorithm Hash digest
SHA256 dc3bdbec0658ef6fd576a372d2f829cad268811a124c1d303512a7719f4b6d6f
MD5 aebcc4c8f8d6aba4c878e8a3460b8a63
BLAKE2b-256 9bbdc9f1d1a7bdc341de842aa9b295bc8c77f777edfb8d3f3ad6128ab6e59bb9

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