anchor.diff:  end;
   
   
  -function Py_RunPlugin_Command(const AModule, AMethod: string;
  -  const AParams: array of string): string;
  -var
  -  SObj: string;
  -  SCmd1, SCmd2: string;
  +function Py_RunPlugin_Command(const AModule, AMethod: string; const AParams: array of string): string;
  +var
  +  SObj, SCmd: string;
   begin
     SObj:= '_cudacmd_' + AModule;
   
  -  SCmd1:=
  -    Format('import %s               ', [AModule]) + SLineBreak +
  -    Format('if "%s" not in locals():', [SObj]) + SLineBreak +
  -    Format('    %s = %s.Command()   ', [SObj, AModule]) + SLineBreak;
  -  if UiOps.PyInitLog then
  -    SCmd1:= SCmd1+
  -    Format('    print("Init: %s")',    [AModule]);
  -
  -  SCmd2:=
  -    Format('%s.%s(%s)', [SObj, AMethod, Py_ArgListToString(AParams)]);
  -
  -  try
  +  if not IsPyLoadedLocal(SObj) then
  +  begin
  +    if UiOps.PyInitLog then
  +      MsgLogConsole('Init: '+AModule);
       with GetPythonEngine do
       begin
  -      ExecString(SCmd1);
  -      Result:= EvalStringAsStr(SCmd2);
  -    end;
  +      ExecString(Format('import %s;%s=%s.Command()', [AModule, SObj, AModule]));
  +    end;
  +    PyLoadedModules.Add(AModule);
  +    PyLoadedLocals.Add(SObj);
  +  end;
  +
  +  try
  +    SCmd:= Format('%s.%s(%s)', [SObj, AMethod, Py_ArgListToString(AParams)]);
  +    with GetPythonEngine do
  +      Result:= EvalStringAsStr(SCmd);
     except
     end;
   end;
  
positive.code: 
    SObj:= '_cudacmd_' + AModule;
  
    if not ALazy then
    begin
      Str1:= 'import cudatext' + SLineBreak +
        Format('import %s',                [AModule]) + SLineBreak +
        Format('if "%s" not in locals():', [SObj]) + SLineBreak +
        Format('    %s = %s.Command()',    [SObj, AModule]) + SLineBreak;
      if UiOps.PyInitLog then
        Str1:= Str1+
        Format('    print("Init: %s")',    [AModule]);
      Str2:=
        Format('%s.%s(%s)', [SObj, ACmd, SParams]);
  
      try
        with GetPythonEngine do
        begin
          ExecString(Str1);
          Result:= EvalStringAsStr(Str2);
        end;
      except
      end;
    end
    else
    begin
      Str1:=
        'import cudatext' + SLineBreak +
        '_ = None' + SLineBreak +
        Format('if "%s" in locals():', [SObj]) + SLineBreak +
        Format('    _ = %s.%s(%s)',    [SObj, ACmd, SParams]);
  
      try
        with GetPythonEngine do
        begin
          ExecString(Str1);
          Result:= EvalStringAsStr('_');
        end;
      except
      end;
    end;
  end;
  
  function Py_rect(const R: TRect): PPyObject; cdecl;
  
negative.code:   cPyNone = 'None';
  
  implementation
  
  var
    PyLoadedModules: TStringList = nil;
    PyLoadedLocals: TStringList = nil;
  
  function IsPyLoadedModule(const S: string): boolean; inline;
  begin
    Result:= PyLoadedModules.IndexOf(S)>=0;
  end;
  
  function IsPyLoadedLocal(const S: string): boolean; inline;
  begin
    Result:= PyLoadedLocals.IndexOf(S)>=0;
  end;
  
  
  procedure Py_SetSysPath(const Dirs: array of string; DoAdd: boolean);
  var
  