IPythonSerializer.SaveModuleToFile

Syntax

SaveModuleToFile(Module: IPythonModule; FileName: String);

Parameters

Module. Python module to be saved.

FileName. Path and name of the file, to which Python module is to be saved.

Description

The SaveModuleToFile method saves the specified Python module to file.

Example

Executing the example requires that the repository contains a Python module with the test_python identifier.

Add links to the Metabase, Python system assemblies.

Sub UserProc;
Var
    MB: IMetabase;
    Ps: IPythonSerializer;
    Module: IPythonModule;
Begin
    MB := MetabaseClass.Active;
    Ps := 
New PythonSerializer.Create;
    Module := MB.ItemById(
"test_python").Bind As IPythonModule;
    Ps.SaveModuleToFile(Module, 
"D:\test.py");
End Sub UserProc;

After executing the example the specified Python module will be saved to file.

See also:

IPythonSerializer