<< pyGetEnvId Python Interaction Mechanism in Scilab pyGetFields >>

Python Interaction Mechanism in Scilab >> Python Interaction Mechanism in Scilab > pyGetField

pyGetField

Get the value of the field of a Python object.

Calling Sequence

val = pyGetField(obj, name [, mustUnwrap])

Arguments

obj

A Python object or a wrappable Scilab variable.

name

A string

mustUnwrap

A boolean

val

Scilab data or Python object

Description

Get the value of a field if the field name exists. If mustUnwrap is set to true, then the returned value is unwrapped when it is possible.

By default, the fields starting with an underscore cannot be read, but this behaviour can be changed in using pyShowPrivate.

Examples

pyImport os
// return a Python object
s = pyGetField(os, "name")

// return a Scilab string
s = pyGetField(os, "name", %t)

pyRemove os s

See Also

History

VersionDescription
5.4.0 Python module.

Report an issue
<< pyGetEnvId Python Interaction Mechanism in Scilab pyGetFields >>