IPythonModule.Text

Syntax

Text: String;

Description

The Text property determines a module text.

Example

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

Add links to the Metabase, Python system assemblies.

Sub UserProc;
Var
    Mb: IMetabase;
    PythonMod: IPythonModule;
Begin
    Mb := MetabaseClass.Active;
    PythonMod := Mb.ItemById(
"MOD_PYT").Edit As IPythonModule;
    Debug.WriteLine(PythonMod.Text);
    //...
    //Further work with module text
    //...
    If PythonMod.Modified Then
        (PythonMod 
As IMetabaseObject).Save;
    
End If;
End Sub UserProc;

The specified example generally shows how Python module text can be obtained. The text will be displayed in the environment console. If some changes are made in the text, the Python module will be saved.

See also:

IPythonModule