Using Zeus with Python

Find Tips and tricks on how to better use the Zeus IDE. Feel free to post your own tips but please do not post bug reports, feature requests or questions here.
Post Reply
jussij
Site Admin
Posts: 2650
Joined: Fri Aug 13, 2004 5:10 pm

Using Zeus with Python

Post 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 26729 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 30521 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 26728 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
Post Reply