You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Install **_EasyCoder_** in your Python environment:
13
13
```
14
-
pip install easycoder
14
+
pip install requests pytz easycoder
15
15
```
16
-
You may also need to install `pytz`, as some commands need it.
17
16
18
-
Write a test script, 'hello.ecs', containing the following:
17
+
Test the install by typing the command `easycoder`.
18
+
<hr>
19
+
On Linux, this will probably fail as the installer places the executable file in the `$HOME/.local/bin` directory. So give the command
20
+
```
21
+
export PATH=$HOME/.local/bin:$PATH
22
+
```
23
+
24
+
To make this change permanent, edit your `.profile` file, adding the following:
25
+
```
26
+
# set PATH so it includes user's private .local/bin if it exists
27
+
if [ -d "$HOME/.local/bin" ] ; then
28
+
PATH="$HOME/.local/bin:$PATH"
29
+
fi
30
+
```
31
+
<hr>
32
+
33
+
Now write a test script, 'hello.ecs', containing the following:
19
34
```
20
35
print `Hello, world!`
21
36
```
22
-
This is traditionally the first program to be written in virtually any language. To run it, use `easycoder hello.ecs`.
37
+
(Note the backticks.) This is traditionally the first program to be written in virtually any language. To run it, use `easycoder hello.ecs`.
23
38
24
39
The output will look like this (the version number will differ):
25
40
```
@@ -52,19 +67,18 @@ Here in the repository is a folder called `scripts` containing some sample scrip
52
67
`benchmark.ecs` allows the performance of **_EasyCoder_** to be compared to other languages if a similar script is written for each one.
53
68
54
69
## Graphical programmming
55
-
**_EasyCoder_** includes a graphical programming environment that is in the early stages of development. A couple of demo scripts are included in the `scripts` directory. To run them, first install the Python `kivy` graphics library if it's not already present on your system. This is done with `pip install kivy`. Then run your **_EasyCoder_** script using `easycoder {scriptname}.ecg`.
56
-
57
-
Graphical scripts look much like any other script but their file names must use the extension `.ecg` to signal to **_EasyCoder_** that it needs to load the graphics module. Non-graphical applications can use any extension but `.ecs` is recommended. This allows the **_EasyCoder_** application to be used wherever Python is installed, in either a command-line or a graphical environment, but graphics will of course not be available in the former.
58
-
59
-
Some demo graphical scripts are included in the `scripts` directory:
70
+
**_EasyCoder_** includes a graphical programming environment that is in the early stages of development. Some demo scripts will be included in the `scripts` directory; these can be recognised by the extension`.ecg`. To run them, first install `tkinter`. On Linux this is done with
71
+
```
72
+
sudo apt install python3-tk
73
+
```
60
74
61
-
`graphics-demo.ecg` shows some of the elements that can be created, and demonstrates a variety of the graphical features of the language such as detecting when elements are clicked.
75
+
Next, install the Python `pySimpleGUI` graphics library; this is done with `pip install pysimplegui`. Then run your **_EasyCoder_** script using `easycoder {scriptname}.ecg`.
62
76
63
-
`wave.ecg` is a "Mexican Wave" simulation.
77
+
Graphical scripts look much like any other script but their file names must use the extension `.ecg`to signal to **_EasyCoder_** that it needs to load the graphics module. Non-graphical applications can use any extension but `.ecs`is recommended. This allows the **_EasyCoder_** application to be used wherever Python is installed, in either a command-line or a graphical environment, but graphics will of course not be available in the former.
64
78
65
-
`keyboard.ecg` creates an on-screen keyboard (currently a 4-function calculator keypad) that responds to clicks on its keys. It uses a plugin module (see below) to add extra vocabulary and syntax to the language. This is currently under development so its features are likely to change. The intention is to support a wide range of keyboard styles with the minimum mount of coding. The plugin (`ec_keyword.py`) can be downloaded from the repository.
79
+
Some demo graphical scripts will included in the `scripts` directory as development proceeds.
66
80
67
-
**_EasyCoder_** graphics are handled by a library module, `ec_renderer` that can be used outside of the **_EasyCoder_** environment, in other Python programs. The renderer works with JSON-formatted specifications of the itens to be displayed.
81
+
`gtest.ecg` contains sample code to demonstrate and test basic features.
0 commit comments