REPORTER 22.1
Python
Python
Python is a high-level, general-purpose programming language. It is dynamically typed, garbage-collected and with an emphasis on code readability and compact syntax.
Starting with REPORTER 21.0, a new Python API has been introduced, promising enhanced flexibility and functionality for projects. This API mirrors the classes, methods and properties found in the JavaScript API, while also leveraging Python's great performance in CPU-intensive tasks and data processing.
The main advantages of the Python API are:
- Python scripts run outside the programs (REPORTER, PRIMER, etc.), not inside, as JavaScript scripts do. This makes it more versatile as it allows the same Python script to connect to multiple programs (REPORTER, PRIMER, etc.);
- The same script can be used for data processing, file manipulation and/or to communicate with other software that feature a Python API, e.g. Ansys LS-DYNA, Microsoft Excel, etc;
- Python is a beginner-friendly language with a short learning curve;
- Python is an authentic object-oriented programming language that allows for the creation of class-based inheritance structures;
- There are many modules and libraries ready-to-use in Python which can easily be installed via a package manager and imported into the script.
For more information on the Python API, see the Python API reference manual.
For a tutorial on how to use the Python API in REPORTER, see REPORTER Tutorials.