Questions tagged [python4delphi]

Python4delphi is set of open source components for Delphi, which allow to embed Python engine into Delphi programs.

Python4delphi is set of open source components for Delphi, which allow to embed Python engine into Delphi programs.

22 questions
5
votes
2 answers

Python4Delphi: Returning a python object in a function. (DelphiWrapper)

I am using python4delphi. How can I return an object from a wrapped Delphi class function? Code Snippet: I have a simple Delphi Class that I wrapped to Python Script, right? TSimple = Class Private function getvar1:string; Public Published …
Gabriel Fonseca
  • 345
  • 3
  • 12
5
votes
1 answer

How to return a list to Python from Delphi using Python4Delphi

Using Python4Delphi, it is fairly straight forward to expose Delphi methods to Python so that Python can call into a Delphi application. However I have been unable to return a Python list that is created by a Delphi method to Python. For…
rhody
  • 2,274
  • 2
  • 22
  • 40
4
votes
0 answers

How to implement nested objects in Delphi for exposure with python4delphi?

Assume I have a class such as: TArithmetic = class (TPersistent) function add (x, y : double) : double; end; and another class which I want to expose in python: TMath = class (TPersistent) private FArithmetic : TArithmetic; public …
rhody
  • 2,274
  • 2
  • 22
  • 40
3
votes
1 answer

Creating Python extension with Delphi

I'm trying to convert Python function to Delphi using Python4Delphi (to educate myself and to gain speed, I hope). However I've no idea how this works with Delphi and Python. Here's my original function: def MyFunc(img, curve): C = 160 for i in…
Harriv
  • 6,029
  • 6
  • 44
  • 76
3
votes
1 answer

How do I use C API function PyArg_ParseTupleAndKeywords in Delphi?

I am currently writing a Python module using python4delphi. I would like to use the standard C API Function PyArg_ParseTupleAndKeywords. As you can see from the documentation the signature is so: int PyArg_ParseTupleAndKeywords(PyObject *args,…
Lorenzo Persichetti
  • 1,480
  • 15
  • 24
3
votes
1 answer

Is there a way to debug a python script using the python4delphi components?

I want to add scripting capabilities to my application and I just came across python4delphi http://code.google.com/p/python4delphi/, which seems to be stable. At first sight it looks very easy to use on the developers side, but I couldn't find a…
2
votes
1 answer

Get Python Object as Variant

I`m using Python4Delphi I have a python file that a class declared on it like this : class Student: SName = "MyName" SAge = 26 def GetName(self): return SName def GetAge(self): return SAge I want to get a refrence of this class…
Mahmoud_Mehri
  • 1,643
  • 2
  • 20
  • 38
2
votes
1 answer

What part of installed Python does python4delphi use?

I have Python 2.7 installed in "C:\Python27". Now I run 1st demo of Python4delphi with D7, which somehow uses my Py2.7 install folder. If I rename Python folder, demo can't run (without error message). I didn't change properties of a demo form. What…
Prog1020
  • 4,530
  • 8
  • 31
  • 65
1
vote
1 answer

Delphi, Python4Delphi, Anaconda, Oct2Py, and Octave on Windows

I have a Delphi Win32 program that needs to run some scripts on Octave. I've taken the approach of going through Python4Delphi to get to a Python "environment", where I can write and run scripts that access Octave via Oct2Py. In order to get Oct2Py…
Bob
  • 587
  • 8
  • 17
1
vote
1 answer

Python4Delphi-powered program, how to deploy it?

My Delphi program uses Python4Delphi, and the Python script uses some standard libs. When deploying my program I don't want an entire Python installation, and it must work with python27.dll. What are the minimal set of necessary files? The document…
Edwin Yip
  • 4,089
  • 4
  • 40
  • 86
1
vote
1 answer

Python4Delphi can't import numpy

I was curious about Python4Delphi and installed it and looked through the demos a bit. Now I wanted to install Numpy via CMD with pip this went well without errors. but now when I enter the following code in DEMO01 of Python4Delphi I get an error…
1
vote
0 answers

Using Python4Delphi in Delphi programs to execute Delphi code

Good day everyone! I have a question. Perhaps someone has already experienced this. I have a ready-made program on Delphi. And I need to initialize and execute all the functions of this program using a Python script. Is it possible to accomplish…
Ahriman
  • 11
  • 1
1
vote
0 answers

Why has the parameter of my Delphi function with PyDelphiWrapper always a fix wrong value?

I am using Python4Delphi and try to get the demo WrapDelphiDemo running. What it should do is to calculate the amount of prime numbers for values up to 1000000. The expected value is 78498 but when I let the demo code running I get 575843. I found…
Jo. D.
  • 21
  • 3
1
vote
1 answer

Python4Delphi - Error in wrapping delphi interface with TPyDelphiWrapper.WrapInterface

I am using Python 3.8 with Delphi 10.4.2. I am trying to use the components of Python4Delphi to access through a Python script some interfaces defined in Delphi. At design-time I added the TPythonEngine, TPythonModule and TPyDelphiWrapper components…
1
vote
0 answers

Find correct python4delphi Tpythonengine parameters

while using Tpythonengine from here python 4 delphi I fail to get my code *.exe running on a different system, due to differences in the python config on these computers. Following the idea of sample code initial idea I completed the way of…
user1769184
  • 1,571
  • 1
  • 19
  • 44
1
2