<< pyUseScilabIndex Python Interaction Mechanism in Scilab pyWrapAsRef >>

Python Interaction Mechanism in Scilab >> Python Interaction Mechanism in Scilab > pyWrap

pyWrap

Wrap a Scilab data into a Python object

Calling Sequence

X = pyWrap(x)

Arguments

x

A double or boolean or integer or string matrix.

X

A Python object

Description

The Scilab data is converted into a Python one. By default, a row is converted into a list and a matrix into a list of lists. All the integer data are converted into a Python long.

It is possible to use a Numpy wrapping in enabling it with pyUseNumpy. But take care: a single data (like 123 or 'foo') is always wrapped with a basic Python type (never an instance of ndarray).

Examples

pyImport math
a = math.sqrt(144);
// a is Python number wrapped in an External Object (_EObj)
typeof(a)
// we can unwrap a
A = pyUnwrap(a);
// A is a Scilab double
typeof(A)

// Now we enable auto-unwrapping
pyAutounwrap(%t)
b = math.sqrt(144)
typeof(b)

pyAutounwrap(%f)
pyRemove math a

See Also

History

VersionDescription
5.4.0 Python module.

Report an issue
<< pyUseScilabIndex Python Interaction Mechanism in Scilab pyWrapAsRef >>