impure functionexchange
Function that communicates with Python
Information
This function exchanges data with Python. See Buildings.Utilities.IO.Python_3_12.UsersGuide for instructions, and Buildings.Utilities.IO.Python_3_12.Functions.Examples for examples.
Inputs
| Type | Name | Default | Description |
|---|---|---|---|
| String | moduleName | Name of the python module that contains the function | |
| String | functionName | moduleName | Name of the python function |
| BaseClasses.PythonObject | pytObj | Memory that holds the Python object | |
| Boolean | passPythonObject | Set to true if the Python function returns and receives an object, see User's Guide | |
| String | pythonPath | Value of PYTHONPATH environment variable | |
| Real[max(1, nDblWri)] | dblWri | Double values to write | |
| Integer[max(1, nIntWri)] | intWri | Integer values to write | |
| String[max(1, nStrWri)] | strWri | String values to write | |
| Integer | nDblWri | Number of double values to write | |
| Integer | nDblRea | Number of double values to read | |
| Integer | nIntWri | Number of integer values to write | |
| Integer | nIntRea | Number of integer values to read | |
| Integer | nStrWri | Number of strings to write |
Outputs
| Type | Name | Default | Description |
|---|---|---|---|
| Real[max(1, nDblRea)] | dblRea | Double values returned by Python | |
| Integer[max(1, nIntRea)] | intRea | Integer values returned by Python |
Revisions
-
September 19, 2025, by Michael Wetter:
Updated to Python 3.12. -
September 15, 2025, by Michael Wetter:
Added missing header file.
This is for issue 4343. -
August 27, 2021, by Michael Wetter:
Updated to Python 3.8. -
April 10, 2020, by Jianjun Hu and Michael Wetter:
Updated to Python 3.6. -
March 06, 2020, by Jianjun Hu:
Upgraded python version from 2.7 to 3.6.
This is for issue 1760. -
April 13, 2018, by Michael Wetter:
CorrectedLibraryDirectoryannotation.
This is for issue 1160. -
March 27, 2013, by Thierry S. Nouidui:
Added a wrapper toModelicaFormatErrorto support Windows OS. -
January 31, 2013, by Michael Wetter:
First implementation.