Import a module in Scilab environment
[mod =] pyImport(moduleName [, isNewVar]])
a string containing the module name.
a a boolean.
Import a Python module in the Scilab environment. It is possible to append the module path to sys.path in using pyAddToPath. If isNewVar is true or omitted a new Scilab variable with the base module name (the name is the string before the first dot) is created, else a variable is returned.
It is possible to attach the module in Python environment as if 'import' was called in calling pyAttachModule(%t). In this case all the module name can be used. In the case where %T is given as second argument, the value of pyAttachModule as no effect.
pyAttachModule(%t) pyImport os.path; s = os.path.getsize(pathconvert("SCI/modules/elementary_functions/macros/cosh.sci", %f)) // In Python environment you can use os.path pyEvalStr("print os.path.getsize(""" + pathconvert("SCI/modules/elementary_functions/macros/cosh.sci", %f) + """)"); pyRemove(os.path) pyRemove s os | ![]() | ![]() |
Version | Description |
5.4.0 | Python module. |