<< pyTuple Python Interaction Mechanism in Scilab pyUnwrapRem >>

Python Interaction Mechanism in Scilab >> Python Interaction Mechanism in Scilab > pyUnwrap

pyUnwrap

Unwrap a Python object into Scilab data

Calling Sequence

x = pyUnwrap(X)

Arguments

X

A Python object

x

A double or boolean or integer or string matrix.

Description

Unwrap a Python object into a Scilab data. Floats, complexes, integers, booleans and strings can be unwrapped. A one-dimension list is converted a row, a two-dimensional one into a matrix. The Numpy matrices can be unwrapped too.

It is possible to unwrap the returned objects in using the function pyAutounwrap.

Examples

a = 1:10;
sa = sqrt(a);
// We wrap a
A = pyWrap(a);
// We import the math module
pyImport math;

// py is a wrapper for __builtin__ module
py = pyBuiltin()

py_sqrt = pyGetAttr(math,"sqrt");
SA = py.map(py_sqrt, A)

// SA and sa should contain the same values
and(pyUnwrap(SA) == sa)

pyRemove A math py py_sqrt SA

See Also

History

VersionDescription
5.4.0 Python module.

Report an issue
<< pyTuple Python Interaction Mechanism in Scilab pyUnwrapRem >>