Jump to content

Paschalis

Members
  • Content Count

    1
  • Joined

  • Last visited

Everything posted by Paschalis

  1. Hello @Juan C.Cilleruelo and @AndreasSt, I had the same issue and managed to retrieve the TPythonDelphiVar like this. function TPythonViewModel.GetDelphiVar: string; var PyResult: PPyObject; begin FPythonDelphiVar.Engine := FPythonEngine; FPythonDelphiVar.Module := '__main__'; FPythonDelphiVar.VarName := 'DelphiVar'; FPythonDelphiVar.Initialize; FPythonEngine.ExecString('DelphiVar ="Hello"'); PyResult := FPythonEngine.EvalString('DelphiVar'); if PyResult <> nil then Result := FPythonEngine.PyObjectAsString(PyResult) else Result := 'Error: EvalString returned nil'; end;
×