procedure TPythonInterface.CheckPython;
begin
if not Initialized then
raise Exception.Create('Python is not properly initialized' );
end;
function TPythonInterface.GetInitialized: Boolean;
begin
if Assigned(Py_IsInitialized) then
Result := Py_IsInitialized() <> 0
else
Result := FInitialized;
end;
this is called on each EvalString/Execstring. it calls Py DLL (in Initialized), no good. i suggest to add cache boolean var: if Py_IsInitialized got True, save this var to True and don't call Py_IsInitialized in DLL again.
this is called on each EvalString/Execstring. it calls Py DLL (in Initialized), no good. i suggest to add cache boolean var: if Py_IsInitialized got True, save this var to True and don't call Py_IsInitialized in DLL again.