AndreasSt
Members-
Content Count
5 -
Joined
-
Last visited
Everything posted by AndreasSt
-
Hello, I am Creating a TPythonEngine at runtime from code, excecute a script and then free all things again. In the task manager the memory of the app increases everytime I do this action. So I think there is an error in my software. Perhaps I have forgotten a step. I have done the test with the p4d installed by getit and as second version with the current master from github Thanks a lot for any help. procedure TForm1.Button1Click(Sender: TObject); var myPythonEngine: TPythonEngine; pdvTest: TPythonDelphiVar; myScript:TStringlist; begin myScript:=TStringlist.Create; myScript.Add(''); myScript.Add('s="'+Edit1.Text+'"'); myScript.Add('if s.find("g")>=0:'); myScript.Add(' sTest.value="Good"'); myScript.Add(' st="OK"'); myScript.Add('else:'); myScript.Add(' sTest.value="Bad"'); myScript.Add(' st="NOK"'); myPythonEngine:=TPythonEngine.Create(self); myPythonEngine.LoadDll; pdvTest:= TPythonDelphiVar.Create(myPythonEngine); pdvTest.VarName:= 'sTest'; pdvTest.Module:='__main__'; pdvTest.Engine:=myPythonEngine; pdvTest.Initialize; try myPythonEngine.ExecStrings(myScript); except on E: Exception do memo1.lines.add(E.Message); end; myscript.Free; memo1.Lines.Add(pdvTest.ValueAsString); pdvTest.Free; myPythonEngine.Free; end;
-
Thanks for the fast reply. I now have uninstalled p4d from getit and reinstalled it. Now the Timestamp in getit for p4d is 27Aug 2024. So perhaps it comes with newer sources than my installation before. (the result in my app was the same as before, memory cosumption increases everytime I call the execution of the script) So now I will try the other way you mentioned to be sure that I am not hunting an issue already fixed.
-
Hello, I am using p4d from getit in Delphi 12.1. I do not know which version of p4d this is. There is no update notice in the getit manager. But when executing a simple script, each call increases the memory of my sample app. Does anybody know if the bug fix is done in the version from getit in 12.1? Or should I use p4d without getit and install/update it another way? Thanks a lot
-
My App with FMX on Windows has a standard TChart with a around 10 fastline series. Every series has a lot of data-points. After loading the data in the chart I will just set a tPanel( also on the form) from visible:= False to true. The displaying of the panel takes about 4 seconds. The same when hiding the panel again. To show this issue I have made a small test app, see attached. The testcase has these steps: 1. click fillchart - this takes some time, but this is not my issue 2. click showpanel and see how long it takes. Same when click and pull the border of the form to enlarge the form. (Chart ist not aligned as client so the size does not change) The app show the amount of chart repaint events in a label. This is done with a timer and in the event afterdraw of the chart the amount will be increased. So if you playing with the app size, clicking the chart, moving over the legend, click in the memo and so on you see that there are a lot of repaint events. You will also see some commented lines in the code what I have tried to fix this issue. I have made a call to embarcadero and the technician has checked it and the result ist that this should be a tchart issue. So I will be happy for all ideas and help. Thanks a lot. Andreas chartTest.zip
-
tpythondelphivar Creation of TPythonDelphiVar on-the-fly don't works as expected.
AndreasSt replied to Juan C.Cilleruelo's topic in Python4Delphi
Hello Juan, Do you have fixed this issue or do you have another solution? thanks Regards Andreas