Python

Record and execute Python Scripts

Install Python Plugin

Apple logo On macOS, running python scripts from the application requires prior installation of python 3.10 available on the Go to Python download page. Python download page.

Linux logo On Linux, no action is required, a Python distribution is included in the installer.

On Windows, select Install python plugin from the Macros menu.

Once the download is finished, click on the Yes button for installing a python interpreter under the Acwato installation directory and restart the application.

⚠ The python installer that is download is only a part of the original Python disribution. It allows the application to initialize an embedded Python interpreter required for executing Python scripts from the application. You can also download it by clicking on this link.

💡 Using the Python module does not require installing the Python plugin.

Save and execute Python scripts from the application

The Macros menu contains Load, Save and Clear items.

All actions perfomed through the graphical user interface are recorded if Record Macro is checked in your Settings.

In that case, the macro can be saved as a Python script using the menu Macro > Save that opens a file chooser for selecting the file in which the Python script (.py) will be saved.

Python scripts can be edited and executed using the menu Macro > Load. The script is executed by the Python interpreter embedded in the application.

The menu Macro > Clear removes all the previously recorded actions.

Some example Python scripts are available in the user directory after installation (see here).

Python Module

A binary Python module library is also available after installation. This allows you to access all the Acwato functionalities from any Python Integrated Development Environment (IDE) such as Idle provided in Python distributions. The Python version of the IDE must be compatible with Python 3.10.

The acwato Python module file can be found in

The Python script import_acwato.py available in the user directory set the Python path and load the acwato module can be opened in Idle.
Afterwards, when selecting the menu Run > Run Module from IDLE, Acwato will lauch and all commands that can be recorded by the Application can be executed from the Idle console: typing LoadMacro('some_recorderd_script.py') in IDLE console, you can execute a script previously saved by the application.

Click on the following links to get Python function documentation available for Audio, DSP, Global Command and Acoustic Graph

You can always use the menu Macro > Save afer some actions in the GUI and edit the .py file in order to see the corresponding python syntax.

Meanwhile, functions available in the acwato Python module contains a short docstring that can be accessed from most Python IDE and correspond to an action from the GUI.

Known Issues

Windows

The macro submenus are disbaled when the Acwato GUI is launched from an external Python interpreter.

macOS

The Acwato GUI is non-interactive when launched from an external Python interpreter. Moreover, when launched from Idle, audio recording is not available since Idle does not request Microphone access on macOS. Audio recording will be available if acwato module is loaded from some other IDE such as Microsoft Visual Studio Code.

Linux

It can occur that a picture generated while executing a python script has a greater height that the one obtained during recording. It seems that the title bar of the window is not displayed and the corresponding title bar height is added to the plots included in it. When executing a python script from an external IDE (e.g. Idle) the pictures are not properly displayed on screen but are almost correct (excep for the possible greater height) in the generated picture (.png) files.

The following dialog box can pops up while executing a python scripts.

In such a case, just wait the execution ends since clicking on Wait will cause the dialog box to pops up again. If you want to extend the period of time after which the box pops up, you cat type the following command that set it for 30 sec (30000 ms).

                gsettings set org.gnome.mutter check-alive-timeout 30000
            

If the script is loaded from an external Python IDE, the dialog box becomes: