thank you again.
I checked a few things and finally, to build the my DLL project and avoid importing numpy , scipy, vmdpy,emd,PyEMD,... etc., for each function call, I implemented them in the "initialization" section. In this way, only calculations are performed in functions. Of course, as you said, there was no big difference in performance cost, it just got a little better.
The point that I noticed is the large size of the DLL file, which is about 8 MB. Is this normal based on the functions of the library that should be loaded or is there a solution for it?What do you suggest to increase performance using DLL to calculate python scripts?
And another point, is there a complete document of all functions, methods, etc. for P4D that I can download?
i appreciate you for your attention and guidance and excuse me if i don't create new topic I thought that if someone wants to create a DLL file with p4d, they might have the same problems and they will find answers to their questions here.
function PyInit:integer;
var
script:string;
begin
try
if (not Assigned(PythonEngine)) then
begin
PythonEngine := TPythonEngine.Create(nil);
PythonEngine.AutoFinalize:=true;
PythonEngine.UseLastKnownVersion:=true;
PythonModule := TPythonModule.Create(nil);
PythonModule.ModuleName:='MyDelphiModule';
PythonModule.Engine:=PythonEngine;
PythonEngine.LoadDll;
script :=
'import numpy as np'+ sLineBreak +
'from PyEMD import CEEMDAN'+ sLineBreak +
'from vmdpy import VMD'+ sLineBreak;
GetPythonEngine.ExecString(UTF8Encode(script));
end;
Result:=0;
except
Result:=1;
end;
end;
initialization
MaskFPUExceptions(True);
PyInit;