This function is a wrapper for
Buildings.Utilities.IO.Python_3_8.Functions.BaseClasses.exchange.
It adds the directory
modelica://Buildings/Resources/Python-Sources to the
environment variable PYTHONPATH prior to calling the
function that exchanges data with Python. After the function call,
the PYTHONPATH is set back to what it used to be when
entering this function. See Buildings.Utilities.IO.Python_3_8.UsersGuide
for instructions, and Buildings.Utilities.IO.Python_3_8.Functions.Examples
for examples.
impure function exchange extends Modelica.Icons.Function; input String moduleName "Name of the python module that contains the function"; input String functionName = moduleName "Name of the python function"; input BaseClasses.PythonObject pytObj "Memory that holds the Python object"; input Boolean passPythonObject "Set to true if the Python function returns and receives an object, see User's Guide"; input Real dblWri[max(1, nDblWri)] "Double values to write"; input Integer intWri[max(1, nIntWri)] "Integer values to write"; input String strWri[max(1, nStrWri)] "String values to write"; input Integer nDblWri(min = 0) "Number of double values to write"; input Integer nDblRea(min = 0) "Number of double values to read"; input Integer nIntWri(min = 0) "Number of integer values to write"; input Integer nIntRea(min = 0) "Number of integer values to read"; input Integer nStrWri(min = 0) "Number of strings to write"; output Real dblRea[max(1, nDblRea)] "Double values returned by Python"; output Integer intRea[max(1, nIntRea)] "Integer values returned by Python"; end exchange;
PYTHONPATH correctly
independent of working directory.PYTHONPATH.