Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork320
Open
Description
Hello, the OnSendUniData event assigned to TPythonGUIInputOutput is not WORK.
typeTRcv = classprocedure PythonInputOutputSendUniData(Sender: TObject; const Data: string);end;varPythonEngine: TPythonEngine;PythonInputOutput:TPythonGUIInputOutput;Rcv:TRcv;Temp:string;{ TRcv }procedure TRcv.PythonInputOutputSendUniData(Sender: TObject; const Data: string);beginTemp:='Event triggered'; //end;function execpythonscript(const Filename:string):string;begin Result:=''; PythonEngine := TPythonEngine.Create(nil); PythonInputOutput:=TPythonGUIInputOutput.Create(nil); PythonInputOutput.OnSendUniData:=Rcv.PythonInputOutputSendUniData; PythonInputOutput.UnicodeIO:=True; PythonInputOutput.DelayWrites:=True; PythonEngine.IO:=PythonInputOutput; PythonEngine.InitThreads := True; PythonEngine.UseLastKnownVersion := True PythonEngine.AutoLoad := False; PythonEngine.AutoUnload := False; PythonEngine.AutoFinalize := True; PythonEngine.RedirectIO := True; PythonEngine.LoadDll; TPythonThread.Py_Begin_Allow_Threads;FGILState := PythonEngine.PyGILState_Ensure;tryPythonEngine.ExecFile(Filename);exceptend;PythonEngine.PyGILState_Release(FGILState);Result:=Temp; //Always emptyend;
Metadata
Metadata
Assignees
Labels
No labels