Examples
Below are two simple examples that shows how to run commands in both API supported by the application:
Run JavaScript commands
Most JavaScript functions in the API return String or JSON data, which makes them easy to manipulate within the Python script. There shouldn’t be any major problems in sending and receiving data.
Create a Python script file named example_js.py and add the following code:
Run Python commands
Most Python functions may return objects which cannot be passed into the remote script, this means that in order receive data they need to be explicitly converted to strings or Json dictionaries.
To make things easier, it is possible to create custom python script that is loaded during the startup of the application and call functions that handle this kind of conversion without having to rely on inline conversions.
Create a python script file named example_py.py and add the following code:
If the application is running from the command line, then running this script will make it execute commands and retrieve their results.
Was this content helpful?
Announcements
Get hands-on with agentic AI.
Explore how AI agents work together through real examples and hands-on practice. Join your local User Group to design an agent workflow with your peers and leave with a practical framework you can apply to your own work.
Find an event