exporttooml

Exports the Python variable value to the OML variable.

Syntax

status = exporttooml(PythonVariableName,OMLVariableName)

Inputs

PythonVariableName
Python variable name.
Type: string
OMLVariableName
OML variable name.
Type: string

Outputs

status
Status of the script executed.
1
success
“error message”
failure
Type: int | string

Examples

Exporting logical data to OML:

pofalse = False
status = exporttooml('pofalse', 'omlfalse')
print(status)

1

Exporting integer data to OML:

point = 999
status = exporttooml('point','omlint')
print(status)

1

Exporting precision data to OML:

pofloat=9.99
status = exporttooml('pofloat','omlfloat')
print(status)

1

Exporting complex data to OML:

pocomp=9+9j
status = exporttooml('pocomp','omlcomp')
print(status)

1

Exporting string data to OML:

postring="String Data"
status = exporttooml('postring','omlstring')
print(status)

1

Exporting list data to OML:

polist  = ["a","b","c","d"]
status = exporttooml('polist','omlcell')
print(status)

1

Exporting dictionary data to OML:

polist  = ["a","b","c","d"]
podict = {"key1":1,"key2" : polist }
status = exporttooml('podict','omlstruct')
print(status)

1

Exporting matrix data to OML:

import numpy as np
pomatrix = np.matrix("1 2; 3 4")
status = exporttooml('pomatrix','omlmatrix')
print(status)

1

Exporting an nd matrix data to OML:

import numpy as np
pondarray = np.arange(720).reshape(6,4,2,3,5)
status = exporttooml('pondarray','omlndmatrix')
print(status)

1

Comments

Any error reported is returned as a string. Returns 1 on success.
Table 1. Data Type Mapping
Python Variable Type OML Variable Type Limitations
Bool Logical  
long, Float Number  
Complex Complex  
List Cell (1,n) n:number of elements in list Does not support if the list contains Dict (with limitation), Tupple, Set.
dict Struct Supports only if keys in dict are string or char.
Numpy - array, matrix Matrix Data types supported in OML include: matrix, Bool, Int, long, Float, Complex.
Numpy Ndarray ND Matrix Data types supported in OML include: matrix, Bool, Int, long, Float, Complex.