Page 1 of 1

Using Zeus with Python

Posted: Tue Jan 26, 2021 6:01 am
by jussij
Installation
Since the Zeus IDE is scriptable using the Python language the default Zeus installer also installs a Python environment.

This means to start learning to program in Python no other installations are required.

To test this installation use the Tools, DOS Command Line menu and in the resulting dialog enter in the following command:

Code: Select all

python.exe --version
This command should result in the following output:
Python 3.10.5
Using the Python Shell
Use the Tools, Language Shells, Python REPL menu to bring up the interactive Python REPL environment.

This will bring the interactive Python environment inside the Zeus IDE as shown below:
python-repl.png
python-repl.png (277.87 KiB) Viewed 26738 times
Editing Python Scripts
When editing Python scripts inside the IDE the default installation comes with Jedi Python autocomplete pre-configured:
python-jedi.png
python-jedi.png (251.49 KiB) Viewed 30530 times
It is also very easy to setup the Python language server with more details found here: https://www.zeusedit.com/lsp/python.html

Running Python Scripts
With the Python script as the active document, the Macros, Execute 'test.py' Script menu to run the script inside the editor.
pthon-run.png
pthon-run.png (204.93 KiB) Viewed 26737 times
Alternatively, if the script does not use stdin you can run the script using the Tools, DOS Command Line menu using this command line:

Code: Select all

python.exe "$fn"
In both case the script will be run and any output captured inside the editor.

Cheers Jussi