easycoder 250317.4__tar.gz → 250403.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of easycoder might be problematic. Click here for more details.
- {easycoder-250317.4 → easycoder-250403.2}/PKG-INFO +17 -11
- {easycoder-250317.4 → easycoder-250403.2}/README.md +14 -9
- {easycoder-250317.4 → easycoder-250403.2}/easycoder/__init__.py +1 -1
- {easycoder-250317.4 → easycoder-250403.2}/easycoder/ec_core.py +74 -56
- {easycoder-250317.4 → easycoder-250403.2}/easycoder/ec_graphics.py +38 -1
- {easycoder-250317.4 → easycoder-250403.2}/easycoder/ec_program.py +0 -3
- easycoder-250403.2/test.ecg +17 -0
- easycoder-250403.2/test.ecs +14 -0
- easycoder-250317.4/test.ecs +0 -20
- {easycoder-250317.4 → easycoder-250403.2}/LICENSE +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/README.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/README.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/conditions/boolean.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/conditions/empty.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/conditions/ends.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/conditions/even.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/conditions/exists.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/conditions/greater.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/conditions/hasProperty.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/conditions/includes.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/conditions/is.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/conditions/less.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/conditions/list.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/conditions/none.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/conditions/not.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/conditions/numeric.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/conditions/object.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/conditions/odd.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/conditions/starts.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/conditions/string.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/keywords/add.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/keywords/append.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/keywords/assert.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/keywords/begin.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/keywords/clear.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/keywords/close.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/keywords/create.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/keywords/debug.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/keywords/decrement.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/keywords/delete.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/keywords/divide.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/keywords/exit.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/keywords/file.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/keywords/fork.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/keywords/get.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/keywords/go.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/keywords/gosub.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/keywords/if.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/keywords/import.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/keywords/increment.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/keywords/index.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/keywords/init.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/keywords/input.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/keywords/load.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/keywords/lock.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/keywords/log.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/keywords/module.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/keywords/multiply.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/keywords/negate.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/keywords/open.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/keywords/pop.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/keywords/post.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/keywords/print.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/keywords/push.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/keywords/put.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/keywords/read.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/keywords/release.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/keywords/replace.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/keywords/return.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/keywords/run.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/keywords/save.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/keywords/script.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/keywords/set.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/keywords/split.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/keywords/stack.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/keywords/stop.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/keywords/system.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/keywords/take.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/keywords/toggle.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/keywords/truncate.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/keywords/unlock.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/keywords/variable.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/keywords/wait.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/keywords/while.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/keywords/write.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/values/arg.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/values/args.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/values/cos.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/values/datime.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/values/decode.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/values/element.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/values/elements.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/values/empty.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/values/encode.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/values/error.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/values/files.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/values/float.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/values/from.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/values/hash.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/values/index.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/values/integer.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/values/json.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/values/keys.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/values/left.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/values/length.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/values/lowercase.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/values/memory.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/values/modification.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/values/modulo.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/values/newline.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/values/now.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/values/position.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/values/property.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/values/random.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/values/right.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/values/sin.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/values/stringify.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/values/tab.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/values/tan.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/values/timestamp.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/values/today.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/values/trim.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/values/type.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/values/uppercase.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/values/value.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/core/values/weekday.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/graphics/README.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/graphics/keywords/attach.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/graphics/keywords/close.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/graphics/keywords/create.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/graphics/keywords/ellipse.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/graphics/keywords/image.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/graphics/keywords/move.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/graphics/keywords/on.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/graphics/keywords/rectangle.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/graphics/keywords/render.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/graphics/keywords/run.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/graphics/keywords/set.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/graphics/keywords/text.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/graphics/values/attribute.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/doc/graphics/values/window.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/easycoder/README.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/easycoder/ec_classes.py +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/easycoder/ec_compiler.py +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/easycoder/ec_condition.py +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/easycoder/ec_gutils.py +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/easycoder/ec_handler.py +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/easycoder/ec_timestamp.py +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/easycoder/ec_value.py +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/images/Semoigo Dawn.jpg +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/json/graphics-demo.json +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/plugins/ec_keyboard.py +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/plugins/ec_p100.py +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/plugins/keyboards/4-function.json +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/plugins/keyboards/4-function.png +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/plugins/keyboards/qwerty-0.json +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/plugins/keyboards/qwerty-0.png +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/plugins/keyboards/qwerty-1.json +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/plugins/keyboards/qwerty-1.png +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/plugins/keyboards/qwerty-2.json +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/plugins/keyboards/qwerty-2.png +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/plugins/keyboards/qwerty-3.json +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/plugins/keyboards/qwerty-3.png +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/plugins/points.py +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/pyproject.toml +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/scripts/README.md +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/scripts/benchmark.ecs +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/scripts/config.ecg +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/scripts/connect.ecg +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/scripts/ec_keyboard.py +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/scripts/findxr.ecs +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/scripts/fizzbuzz.ecs +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/scripts/hello.ecs +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/scripts/points.ecs +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/scripts/test.ecs +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/scripts/testg.ecg +0 -0
- {easycoder-250317.4 → easycoder-250403.2}/scripts/tests.ecs +0 -0
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: easycoder
|
|
3
|
-
Version:
|
|
3
|
+
Version: 250403.2
|
|
4
4
|
Summary: Rapid scripting in English
|
|
5
5
|
Keywords: compiler,scripting,prototyping,programming,coding,python,low code,hypertalk,computer language,learn to code
|
|
6
6
|
Author-email: Graham Trott <gtanyware@gmail.com>
|
|
7
7
|
Description-Content-Type: text/markdown
|
|
8
8
|
Classifier: License :: OSI Approved :: MIT License
|
|
9
|
+
License-File: LICENSE
|
|
9
10
|
Requires-Dist: pytz
|
|
10
11
|
Project-URL: Home, https://github.com/easycoder/easycoder-py
|
|
11
12
|
|
|
@@ -44,32 +45,37 @@ fi
|
|
|
44
45
|
Now write a test script, 'hello.ecs', containing the following:
|
|
45
46
|
```
|
|
46
47
|
print `Hello, world!`
|
|
48
|
+
exit
|
|
47
49
|
```
|
|
48
50
|
(Note the backticks.) This is traditionally the first program to be written in virtually any language. To run it, use `easycoder hello.ecs`.
|
|
49
51
|
|
|
50
|
-
The output will look like this (the version number will differ):
|
|
52
|
+
The output will look like this (the version number will likely differ):
|
|
51
53
|
```
|
|
52
|
-
EasyCoder version
|
|
54
|
+
EasyCoder version 250403.1
|
|
53
55
|
Compiled <anon>: 1 lines (2 tokens) in 0 ms
|
|
54
56
|
Run <anon>
|
|
55
|
-
|
|
57
|
+
Hello, world!
|
|
56
58
|
```
|
|
57
59
|
|
|
60
|
+
Why the `exit`? Because EasyCoder can't tell that the program is finished. It might contain elements that are waiting for outside events, so without `exit` it just stops and waits. You can kill it by typing Control-C.
|
|
61
|
+
|
|
58
62
|
It's conventional to add a program title to a script:
|
|
59
63
|
```
|
|
60
64
|
! Test script
|
|
61
65
|
script Test
|
|
62
|
-
|
|
66
|
+
log `Hello, world!`
|
|
67
|
+
exit
|
|
63
68
|
```
|
|
64
|
-
|
|
69
|
+
|
|
70
|
+
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. I've also changed `print` to `log` to get more information from the script. When run, the output is now
|
|
65
71
|
```
|
|
66
|
-
EasyCoder version
|
|
72
|
+
EasyCoder version 250403.1
|
|
67
73
|
Compiled Test: 3 lines (4 tokens) in 0 ms
|
|
68
74
|
Run Test
|
|
69
|
-
3-> Hello, world!
|
|
75
|
+
16:37:39.132311: 3-> Hello, world!
|
|
70
76
|
```
|
|
71
77
|
|
|
72
|
-
As you might guess from the above, the
|
|
78
|
+
As you might guess from the above, the `log` command shows the time and the line in the script it was called from. This is very useful in tracking down debugging print commands in large scripts.
|
|
73
79
|
|
|
74
80
|
Here in the repository is a folder called `scripts` containing some sample scripts:
|
|
75
81
|
|
|
@@ -77,7 +83,7 @@ Here in the repository is a folder called `scripts` containing some sample scrip
|
|
|
77
83
|
`tests.ecs` is a test program containing many of the **_EasyCoder_** features
|
|
78
84
|
`benchmark.ecs` allows the performance of **_EasyCoder_** to be compared to other languages if a similar script is written for each one.
|
|
79
85
|
|
|
80
|
-
## Graphical
|
|
86
|
+
## Graphical programming
|
|
81
87
|
**_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
|
|
82
88
|
```
|
|
83
89
|
sudo apt install python3-tk
|
|
@@ -33,32 +33,37 @@ fi
|
|
|
33
33
|
Now write a test script, 'hello.ecs', containing the following:
|
|
34
34
|
```
|
|
35
35
|
print `Hello, world!`
|
|
36
|
+
exit
|
|
36
37
|
```
|
|
37
38
|
(Note the backticks.) This is traditionally the first program to be written in virtually any language. To run it, use `easycoder hello.ecs`.
|
|
38
39
|
|
|
39
|
-
The output will look like this (the version number will differ):
|
|
40
|
+
The output will look like this (the version number will likely differ):
|
|
40
41
|
```
|
|
41
|
-
EasyCoder version
|
|
42
|
+
EasyCoder version 250403.1
|
|
42
43
|
Compiled <anon>: 1 lines (2 tokens) in 0 ms
|
|
43
44
|
Run <anon>
|
|
44
|
-
|
|
45
|
+
Hello, world!
|
|
45
46
|
```
|
|
46
47
|
|
|
48
|
+
Why the `exit`? Because EasyCoder can't tell that the program is finished. It might contain elements that are waiting for outside events, so without `exit` it just stops and waits. You can kill it by typing Control-C.
|
|
49
|
+
|
|
47
50
|
It's conventional to add a program title to a script:
|
|
48
51
|
```
|
|
49
52
|
! Test script
|
|
50
53
|
script Test
|
|
51
|
-
|
|
54
|
+
log `Hello, world!`
|
|
55
|
+
exit
|
|
52
56
|
```
|
|
53
|
-
|
|
57
|
+
|
|
58
|
+
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. I've also changed `print` to `log` to get more information from the script. When run, the output is now
|
|
54
59
|
```
|
|
55
|
-
EasyCoder version
|
|
60
|
+
EasyCoder version 250403.1
|
|
56
61
|
Compiled Test: 3 lines (4 tokens) in 0 ms
|
|
57
62
|
Run Test
|
|
58
|
-
3-> Hello, world!
|
|
63
|
+
16:37:39.132311: 3-> Hello, world!
|
|
59
64
|
```
|
|
60
65
|
|
|
61
|
-
As you might guess from the above, the
|
|
66
|
+
As you might guess from the above, the `log` command shows the time and the line in the script it was called from. This is very useful in tracking down debugging print commands in large scripts.
|
|
62
67
|
|
|
63
68
|
Here in the repository is a folder called `scripts` containing some sample scripts:
|
|
64
69
|
|
|
@@ -66,7 +71,7 @@ Here in the repository is a folder called `scripts` containing some sample scrip
|
|
|
66
71
|
`tests.ecs` is a test program containing many of the **_EasyCoder_** features
|
|
67
72
|
`benchmark.ecs` allows the performance of **_EasyCoder_** to be compared to other languages if a similar script is written for each one.
|
|
68
73
|
|
|
69
|
-
## Graphical
|
|
74
|
+
## Graphical programming
|
|
70
75
|
**_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
76
|
```
|
|
72
77
|
sudo apt install python3-tk
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import json, math, hashlib, threading, os, subprocess, sys, requests, time, numbers, base64, binascii
|
|
1
|
+
import json, math, hashlib, threading, os, subprocess, sys, requests, time, numbers, base64, binascii, random
|
|
2
2
|
from psutil import Process
|
|
3
3
|
from datetime import datetime, timezone
|
|
4
4
|
from random import randrange
|
|
@@ -144,7 +144,7 @@ class Core(Handler):
|
|
|
144
144
|
else:
|
|
145
145
|
return self.compileFromHere(['end'])
|
|
146
146
|
|
|
147
|
-
# Clear (set
|
|
147
|
+
# Clear (set false)
|
|
148
148
|
# clear {variable}
|
|
149
149
|
def k_clear(self, command):
|
|
150
150
|
if self.nextIsSymbol():
|
|
@@ -405,36 +405,40 @@ class Core(Handler):
|
|
|
405
405
|
else:
|
|
406
406
|
FatalError(self.compiler, f'Variable "{symbolRecord["name"]}" does not hold a value')
|
|
407
407
|
if self.nextIs('from'):
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
408
|
+
if self.nextIs('url'):
|
|
409
|
+
url = self.nextValue()
|
|
410
|
+
if url != None:
|
|
411
|
+
command['url'] = url
|
|
412
|
+
command['or'] = None
|
|
413
|
+
get = self.getPC()
|
|
414
|
+
if self.peek() == 'timeout':
|
|
415
|
+
self.nextToken()
|
|
416
|
+
command['timeout'] = self.nextValue()
|
|
417
|
+
else:
|
|
418
|
+
timeout = {}
|
|
419
|
+
timeout['type'] = 'int'
|
|
420
|
+
timeout['content'] = 5
|
|
421
|
+
command['timeout'] = timeout
|
|
422
|
+
self.addCommand(command)
|
|
423
|
+
if self.peek() == 'or':
|
|
424
|
+
self.nextToken()
|
|
425
|
+
self.nextToken()
|
|
426
|
+
# Add a 'goto' to skip the 'or'
|
|
427
|
+
cmd = {}
|
|
428
|
+
cmd['lino'] = command['lino']
|
|
429
|
+
cmd['domain'] = 'core'
|
|
430
|
+
cmd['keyword'] = 'gotoPC'
|
|
431
|
+
cmd['goto'] = 0
|
|
432
|
+
cmd['debug'] = False
|
|
433
|
+
skip = self.getPC()
|
|
434
|
+
self.addCommand(cmd)
|
|
435
|
+
# Process the 'or'
|
|
436
|
+
self.getCommandAt(get)['or'] = self.getPC()
|
|
437
|
+
self.compileOne()
|
|
438
|
+
# Fixup the skip
|
|
439
|
+
self.getCommandAt(skip)['goto'] = self.getPC()
|
|
440
|
+
return True
|
|
441
|
+
return False
|
|
438
442
|
|
|
439
443
|
def r_get(self, command):
|
|
440
444
|
global errorCode, errorReason
|
|
@@ -1414,6 +1418,33 @@ class Core(Handler):
|
|
|
1414
1418
|
|
|
1415
1419
|
return self.nextPC()
|
|
1416
1420
|
|
|
1421
|
+
# Shuffle a list
|
|
1422
|
+
def k_shuffle(self, command):
|
|
1423
|
+
if self.nextIsSymbol():
|
|
1424
|
+
symbolRecord = self.getSymbolRecord()
|
|
1425
|
+
if symbolRecord['valueHolder']:
|
|
1426
|
+
command['target'] = self.getToken()
|
|
1427
|
+
self.add(command)
|
|
1428
|
+
return True
|
|
1429
|
+
self.warning(f'Core.negate: Variable "{symbolRecord["name"]}" does not hold a value')
|
|
1430
|
+
return False
|
|
1431
|
+
|
|
1432
|
+
def r_shuffle(self, command):
|
|
1433
|
+
symbolRecord = self.getVariable(command['target'])
|
|
1434
|
+
if not symbolRecord['valueHolder']:
|
|
1435
|
+
RuntimeError(self.program, f'{symbolRecord["name"]} does not hold a value')
|
|
1436
|
+
return None
|
|
1437
|
+
value = self.getSymbolValue(symbolRecord)
|
|
1438
|
+
if value == None:
|
|
1439
|
+
RuntimeError(self.program, f'{symbolRecord["name"]} has not been initialised')
|
|
1440
|
+
content = value['content']
|
|
1441
|
+
if isinstance(content, list):
|
|
1442
|
+
random.shuffle(content)
|
|
1443
|
+
value['content'] = content
|
|
1444
|
+
self.putSymbolValue(symbolRecord, value)
|
|
1445
|
+
return self.nextPC()
|
|
1446
|
+
RuntimeError(self.program, f'{symbolRecord["name"]} is not a list')
|
|
1447
|
+
|
|
1417
1448
|
# Declare a stack variable
|
|
1418
1449
|
def k_stack(self, command):
|
|
1419
1450
|
return self.compileVariable(command)
|
|
@@ -1780,8 +1811,8 @@ class Core(Handler):
|
|
|
1780
1811
|
token = self.getToken()
|
|
1781
1812
|
value['type'] = token
|
|
1782
1813
|
|
|
1783
|
-
if token
|
|
1784
|
-
|
|
1814
|
+
if token == 'args':
|
|
1815
|
+
return value
|
|
1785
1816
|
|
|
1786
1817
|
if token == 'elements':
|
|
1787
1818
|
if self.nextIs('of'):
|
|
@@ -2013,12 +2044,6 @@ class Core(Handler):
|
|
|
2013
2044
|
value = v
|
|
2014
2045
|
return value
|
|
2015
2046
|
|
|
2016
|
-
def v_directory(self, v):
|
|
2017
|
-
value = {}
|
|
2018
|
-
value['type'] = 'text'
|
|
2019
|
-
value['content'] = os.getcwd()
|
|
2020
|
-
return value
|
|
2021
|
-
|
|
2022
2047
|
def v_element(self, v):
|
|
2023
2048
|
index = self.getRuntimeValue(v['index'])
|
|
2024
2049
|
target = self.getVariable(v['target'])
|
|
@@ -2387,26 +2412,23 @@ class Core(Handler):
|
|
|
2387
2412
|
# Compile a condition
|
|
2388
2413
|
def compileCondition(self):
|
|
2389
2414
|
condition = Condition()
|
|
2390
|
-
condition.negate = False
|
|
2391
2415
|
|
|
2392
2416
|
if self.getToken() == 'not':
|
|
2393
2417
|
condition.type = 'not'
|
|
2394
2418
|
condition.value = self.nextValue()
|
|
2395
|
-
return
|
|
2419
|
+
return condition
|
|
2396
2420
|
|
|
2397
2421
|
if self.getToken() == 'file':
|
|
2398
2422
|
path = self.nextValue()
|
|
2423
|
+
condition.path = path
|
|
2424
|
+
condition.type = 'exists'
|
|
2399
2425
|
token = self.nextToken()
|
|
2400
2426
|
if token == 'exists':
|
|
2401
|
-
condition.type = 'exists'
|
|
2402
|
-
condition.path = path
|
|
2403
2427
|
return condition
|
|
2404
|
-
|
|
2428
|
+
elif token == 'does':
|
|
2405
2429
|
if self.nextIs('not'):
|
|
2406
2430
|
if self.nextIs('exist'):
|
|
2407
|
-
condition.
|
|
2408
|
-
condition.path = path
|
|
2409
|
-
condition.negate = True
|
|
2431
|
+
condition.negate = not condition.negate
|
|
2410
2432
|
return condition
|
|
2411
2433
|
return None
|
|
2412
2434
|
|
|
@@ -2501,13 +2523,10 @@ class Core(Handler):
|
|
|
2501
2523
|
|
|
2502
2524
|
def c_empty(self, condition):
|
|
2503
2525
|
value = self.getRuntimeValue(condition.value1)
|
|
2504
|
-
if
|
|
2505
|
-
comparison =
|
|
2526
|
+
if value == None:
|
|
2527
|
+
comparison = True
|
|
2506
2528
|
else:
|
|
2507
|
-
|
|
2508
|
-
comparison = True
|
|
2509
|
-
else:
|
|
2510
|
-
comparison = len(value) == 0
|
|
2529
|
+
comparison = len(value) == 0
|
|
2511
2530
|
return not comparison if condition.negate else comparison
|
|
2512
2531
|
|
|
2513
2532
|
def c_ends(self, condition):
|
|
@@ -2520,8 +2539,7 @@ class Core(Handler):
|
|
|
2520
2539
|
|
|
2521
2540
|
def c_exists(self, condition):
|
|
2522
2541
|
path = self.getRuntimeValue(condition.path)
|
|
2523
|
-
|
|
2524
|
-
return comparison <= 0 if condition.negate else comparison > 0
|
|
2542
|
+
return os.path.exists(path)
|
|
2525
2543
|
|
|
2526
2544
|
def c_greater(self, condition):
|
|
2527
2545
|
comparison = self.program.compare(condition.value1, condition.value2)
|
|
@@ -161,6 +161,41 @@ class Graphics(Handler):
|
|
|
161
161
|
def r_frame(self, command):
|
|
162
162
|
return self.nextPC()
|
|
163
163
|
|
|
164
|
+
# get {variable} from popup {type} {message} {title}
|
|
165
|
+
def k_get(self, command):
|
|
166
|
+
if self.nextIsSymbol():
|
|
167
|
+
symbolRecord = self.getSymbolRecord()
|
|
168
|
+
if symbolRecord['valueHolder']:
|
|
169
|
+
command['target'] = self.getToken()
|
|
170
|
+
else:
|
|
171
|
+
FatalError(self.compiler, f'Variable "{symbolRecord["name"]}" does not hold a value')
|
|
172
|
+
if symbolRecord['valueHolder']:
|
|
173
|
+
if self.nextIs('from'):
|
|
174
|
+
if self.nextIs('popup'):
|
|
175
|
+
command['ptype'] = self.nextToken()
|
|
176
|
+
command['message'] = self.nextValue()
|
|
177
|
+
command['title'] = self.nextValue()
|
|
178
|
+
self.addCommand(command)
|
|
179
|
+
return True
|
|
180
|
+
return False
|
|
181
|
+
|
|
182
|
+
def r_get(self, command):
|
|
183
|
+
target = self.getVariable(command['target'])
|
|
184
|
+
ptype = command['ptype']
|
|
185
|
+
if ptype == 'text':
|
|
186
|
+
text = psg.popup_get_text(self.getRuntimeValue(command['message']), title=self.getRuntimeValue(command['title']))
|
|
187
|
+
elif ptype == 'ok-cancel':
|
|
188
|
+
text = psg.popup_ok_cancel(self.getRuntimeValue(command['message']), title=self.getRuntimeValue(command['title']))
|
|
189
|
+
elif ptype == 'yes-no':
|
|
190
|
+
text = psg.popup_yes_no(self.getRuntimeValue(command['message']), title=self.getRuntimeValue(command['title']))
|
|
191
|
+
else:
|
|
192
|
+
return None
|
|
193
|
+
v = {}
|
|
194
|
+
v['type'] = 'text'
|
|
195
|
+
v['content'] = text
|
|
196
|
+
self.program.putSymbolValue(target, v)
|
|
197
|
+
return self.nextPC()
|
|
198
|
+
|
|
164
199
|
def k_init(self, command):
|
|
165
200
|
if self.nextIsSymbol():
|
|
166
201
|
symbolRecord = self.getSymbolRecord()
|
|
@@ -219,13 +254,15 @@ class Graphics(Handler):
|
|
|
219
254
|
window['eventHandlers'][key] = lambda: self.run(command['goto'])
|
|
220
255
|
return self.nextPC()
|
|
221
256
|
|
|
257
|
+
# popup {message} {title}
|
|
222
258
|
def k_popup(self, command):
|
|
223
259
|
command['message'] = self.nextValue()
|
|
260
|
+
command['title'] = self.nextValue()
|
|
224
261
|
self.addCommand(command)
|
|
225
262
|
return True
|
|
226
263
|
|
|
227
264
|
def r_popup(self, command):
|
|
228
|
-
psg.popup(self.getRuntimeValue(command['message']))
|
|
265
|
+
psg.popup(self.getRuntimeValue(command['message']), title=self.getRuntimeValue(command['title']))
|
|
229
266
|
return self.nextPC()
|
|
230
267
|
|
|
231
268
|
def k_refresh(self, command):
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
! Test
|
|
2
|
+
|
|
3
|
+
script Test
|
|
4
|
+
|
|
5
|
+
variable Text
|
|
6
|
+
|
|
7
|
+
debug step
|
|
8
|
+
|
|
9
|
+
get Text from popup text `Type something` `Input test`
|
|
10
|
+
popup `You typed ` cat Text `Test`
|
|
11
|
+
|
|
12
|
+
get Text from popup ok-cancel `I'm going to explode!` `OK Cancel test`
|
|
13
|
+
popup `You replied ` cat Text `Test`
|
|
14
|
+
|
|
15
|
+
get Text from popup yes-no `Go ahead?` `Yes No test`
|
|
16
|
+
popup `You replied ` cat Text `Test`
|
|
17
|
+
exit
|
easycoder-250317.4/test.ecs
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
! Test
|
|
2
|
-
|
|
3
|
-
script Test
|
|
4
|
-
|
|
5
|
-
variable Directory
|
|
6
|
-
variable Name
|
|
7
|
-
|
|
8
|
-
! debug step
|
|
9
|
-
|
|
10
|
-
put the directory into Directory
|
|
11
|
-
put the directory cat `/README.md` into Name
|
|
12
|
-
gosub to TestMe
|
|
13
|
-
put the directory cat `/Nothing` into Name
|
|
14
|
-
gosub to TestMe
|
|
15
|
-
exit
|
|
16
|
-
|
|
17
|
-
TestMe:
|
|
18
|
-
if file Name exists print Name cat ` exists`
|
|
19
|
-
if file Name does not exist print Name cat ` does not exist`
|
|
20
|
-
return
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|