The Circuit API > Using API functions
Creating a script file
API creating a script file
As well as typing commands in the Python Command Interpreter, you can write scripts. Here we show you how to write a Python script using the Simcenter Amesim circuit API.
Procedure
Create a file named tutorial_step_1.py.
Edit the file as follows:
Save the file.
Results
You can start your file from a command line prompt, by typing AMEPython tutorial_step_1.py:
Figure 6: Running the Python tutorial script
If you start the file from within Python, type exec(open("tutorial_step_1.py").read())
We are now ready to create an Simcenter Amesim system using the circuit API. This process is detailed in the next section.
Source: https://docs.sw.siemens.com/en-US/doc/254352342/PL20250521841123434.amesim_collection.Circuit_API/Creating_a_script_file · retrieved 2026-07-17