


I modified Demo32:įunction MySelf: TPoint //**access self using function** Now getObj function returns a value - an Integer!! I have run into the same problem while using DelphiWrapper.įirst, enable RTTI using # if the function returns a string for example, it's work. # raise a exception that not find any attributes named getObj. # try access the property var1 and everything is right or Result := PyString_FromString( PAnsiChar(Format('()',)) ) Result := VariantAsPyObject(Format('',)) If PyArg_ParseTuple( args, ':CreateSimple' ) = 0 thenĬlass function TPySimple.DelphiObjectClass: TClass With GetPythonEngine, DelphiObject as TSimple do Owned := True // We own the objects we createĬonstructor TPySimple.CreateWith(PythonType: TPythonType args: PPyObject)

TPySimple = class(TPyDelphiPersistent)Ĭonstructor Create( APythonType : TPythonType ) override Ĭonstructor CreateWith( PythonType : TPythonType args : PPyObject ) override Ĭlass function DelphiObjectClass : TClass override Ĭonstructor TPySimple.Create(APythonType: TPythonType) I made the TPySimple like the demo32 to give class access to the Python code. I have a simple Delphi Class that I wrapped to Python Script, right? TSimple = Class How can I return an object from a wrapped Delphi class function?
