%SYS.Python

class %SYS.Python extends %Library.SystemBase

Python interface
Import a module, and invoke its services.

Method Inventory

Methods

method %DispatchGetProperty(name As %String) as %Integer [ Language = cpp ]
Get a python object attribute.
method %DispatchSetProperty(propName As %Library.String, value As %Library.String) [ Language = cpp ]
Get a python object attribute.
classmethod Builtins(flags As %Integer)
Direct access to python builtins library
classmethod Bytes(cmd As %Binary) as %Integer [ Language = cpp ]
Convert COS string to a python bytes object. The sting cannot contain any wide char.
classmethod ChangeSignalState(state As %Integer) as %Integer [ Language = cpp ]
Set the signal handling state 0 - swap, 1 - disable swapping iris will notify, to python signal handling
classmethod Debugging(state As %Integer) as %Integer [ Language = cpp ]
If passed true, it doesn't reset the error context before invoking any python feature (enable this before invoking any pdb method).
classmethod False() as %Integer [ Language = cpp ]
Returns Python True object.
classmethod Import(name As %Binary) as %Integer [ Language = cpp ]
Loads a module and returns an object.
Returns zero on failure.
classmethod Install(packages As %String, dir As %String = "") as %Status
This is deprecated, please use the pip3 command line to install packages.
classmethod None() as %Integer [ Language = cpp ]
Return python None object that can be used for assignment or as argument.
classmethod Run(cmd As %Binary) as %Integer [ Language = cpp ]
Run a Python cmd, multiple can be separated by new line $c(10)
classmethod SetStdIOMode(flags As %Integer) as %Integer [ Language = cpp ]
if flags bit 1 is set, the stderr (fd 2) output will be redirected to stdout (fd 1) if there is a current COS primary device, otherwise it will behave the original way and log it in messages.log
classmethod Shell(vars As %Integer = 0) as %Status
Interactive Python Shell
classmethod To2DListTyped(contentList As %Integer, typeList As %Integer) as %Integer [ Language = cpp ]
Takes in a 2D ObjectScript $LIST, and another $LIST with type info for each column in the first $LIST.
Returns a copy of the first $LIST as a python list with matching python types.
classmethod ToList(contentList As %Integer) as %Integer [ Language = cpp ]
Takes in an ObjectScript $LIST. Returns a copy of the first $LIST as a python list with matching python types.
classmethod ToListTyped(contentList As %Integer, typeList As %Integer) as %Integer [ Language = cpp ]
Takes in an ObjectScript $LIST, and another $LIST with type info for each element in the first $LIST.
Returns a copy of the first $LIST as a python list with matching python types.
classmethod True() as %Integer [ Language = cpp ]
Returns Python True object.

Inherited Members

Inherited Methods

Feedback