Skip to main content

EasyCoder for Python

Project description

Introduction

This is the Python version of EasyCoder, a high-level English-like scripting language suited for prototyping and rapid testing of ideas. It operates on the command line.

The JavaScript version of EasyCoder, which provides a full set of graphical features to run in a browser, is at https://easycoder.github.io

Quick Start

1: Install EasyCoder in your Python environment:

pip install easycoder

2: Write a test script, 'hello.ecs':

print `Hello, world!`

This is traditionally the first program to be written in virtually any language. To run it under REPL, launch Python and type the following commands:

from easycoder import Program
Program(['hello.ecs'])

The script is passed in as a list because it could be just one of a number of command-line arguments.

The output will look like this:

Compiled <anon>: 1 lines (2 tokens) in 0 ms
Run <anon>
1-> Hello, world!

To avoid having to use REPL you can set up a simple executable command such as this Python script. On Linux the first line will ensure it runs as a command if given execute permission. You can name it 'easycoder' - there's no need for a '.py' extension.

#!/bin/python3

from sys import argv
from easycoder import Program

if (len(argv) > 1):
    Program(argv[1:])
else:
    print('Syntax: easycoder <scriptname> [plugins]')

With this you can run your script with the command easycoder hello.ecs. You can place easycoder anywhere on your system execution path, such as in a local bin directory.

It's conventional to add a program title to a script:

!   Test script

    script Test

    print `Hello, world!`

The first line here is just a comment and has no effect on the running of the script. The second line gives the script a name, which is useful in debugging as it says which script was running. When run, the output is now

Compiled Test: 5 lines (4 tokens) in 0 ms
Run Test
5-> Hello, world!

As you can guess from the above, the print command gives the line in the script it was called from. This is very useful in tracking down debugging print commands in large scripts.

In the repository is a folder called tests containing a couple of sample scripts. benchmark.ecs allows the performance of EasyCoder to be compared to other languages if a similar program is written for each one. tests.ecs is a test program containing many of the EasyCoder features.

The EasyCoder programming language

There are three primary components to the language: 1 Keywords 2 Values 3 Conditions

All program lines start with a keyword - a command to EasyCoder to do something

(Under construction)

Project details


Release history Release notifications | RSS feed

This version

5

Download files

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

Source Distribution

easycoder-5.tar.gz (24.3 kB view details)

Uploaded Source

Built Distribution

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

easycoder-5-py2.py3-none-any.whl (24.2 kB view details)

Uploaded Python 2Python 3

File details

Details for the file easycoder-5.tar.gz.

File metadata

  • Download URL: easycoder-5.tar.gz
  • Upload date:
  • Size: 24.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.31.0

File hashes

Hashes for easycoder-5.tar.gz
Algorithm Hash digest
SHA256 052b13b335920b9eb28af32bce8869dbe431dbda49574174159958a36183b8df
MD5 de13d11c5400a51b15c5073e07f0d2d1
BLAKE2b-256 7ad24e2538aab9dff25d1dff2180a2f31d383ecc126a9591f67e8789c5e6735f

See more details on using hashes here.

File details

Details for the file easycoder-5-py2.py3-none-any.whl.

File metadata

  • Download URL: easycoder-5-py2.py3-none-any.whl
  • Upload date:
  • Size: 24.2 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.31.0

File hashes

Hashes for easycoder-5-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 e4b25e791be024cc7606019d4cc8fc2cac0c50dec7830aaf6e26c2d30e70fddf
MD5 49425cf4ffc6acf3e7f4c589f870caa0
BLAKE2b-256 badf0be086ca31d2ec20ff90828504b8b73a928ce1e5086cc6a0f10b8676a4e4

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