<< pyDict Python Interaction Mechanism in Scilab pyExists >>

Python Interaction Mechanism in Scilab >> Python Interaction Mechanism in Scilab > pyEvalStr

pyEvalStr

Evaluate code in Python environment

Calling Sequence

[output =] pyEvalStr(code [, catchOuput])

Arguments

code

A row or a column of strings.

catchOutput

A boolean.

output

A column of strings.

Description

Evaluate code in Python environment. If catchOuput is set to true (by default it is set to false), then all the Python output is redirect in a string returned as output.

Examples

main = pyMain();
main.a = 1234

// the output is print in the console
pyEvalStr("print a * 2");

// now it is printed in a string
ret = pyEvalStr("print a * 3", %t);
ret

pyRemove main

History

VersionDescription
5.4.0 Python module.

Report an issue
<< pyDict Python Interaction Mechanism in Scilab pyExists >>