Thread overview
Python <==> d call both ways example (with PyD and autowrap)?
Jun 22, 2022
mw
Jun 23, 2022
Marvin
Jun 23, 2022
Tejas
Jun 23, 2022
mw
Jun 23, 2022
Jordan Wilson
June 22, 2022

Hi,

I know with PyD, D can call Python, and with autowrap, Python can call a D .dll, I'm just wondering if someone can show an example that Python <==> d can call both ways? esp. show passing D objects to Python and then call its member function there, and vice versa.

Thanks.

June 23, 2022

On Wednesday, 22 June 2022 at 16:02:00 UTC, mw wrote:

>

Hi,

I know with PyD, D can call Python, and with autowrap, Python can call a D .dll, I'm just wondering if someone can show an example that Python <==> d can call both ways? esp. show passing D objects to Python and then call its member function there, and vice versa.

Thanks.

I would also really like an example. Because it would be great to use Python and D together.

June 23, 2022

On Wednesday, 22 June 2022 at 16:02:00 UTC, mw wrote:

>

Hi,

I know with PyD, D can call Python, and with autowrap, Python can call a D .dll, I'm just wondering if someone can show an example that Python <==> d can call both ways? esp. show passing D objects to Python and then call its member function there, and vice versa.

Thanks.

IIRC the best you can do is embed a Python interpreter inside a D program

https://pyd.readthedocs.io/en/latest/embed.html

June 23, 2022

On Thursday, 23 June 2022 at 02:35:25 UTC, Tejas wrote:

>

IIRC the best you can do is embed a Python interpreter inside a D program

https://pyd.readthedocs.io/en/latest/embed.html

Thanks. I tried something like this:

https://github.com/symmetryinvestments/autowrap/issues/314

Although there were some compilation errors, I was able to built a dll and run.

Maybe that error message is not a real error.

June 23, 2022

On Wednesday, 22 June 2022 at 16:02:00 UTC, mw wrote:

>

Hi,

I know with PyD, D can call Python, and with autowrap, Python can call a D .dll, I'm just wondering if someone can show an example that Python <==> d can call both ways? esp. show passing D objects to Python and then call its member function there, and vice versa.

Thanks.

When I did something like this, I used this as my inspiration:
https://github.com/ariovistus/pyd/tree/master/examples/testdll

So, I used PyD to supply D objects and read Python data also.

Thanks,

Jordan