Thread overview
Python <==> d call both ways example (with PyD and autowrap)?
4 days ago
mw
4 days ago
Marvin
4 days ago
Tejas
4 days ago
mw
4 days ago
Jordan Wilson
4 days ago

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.

4 days ago

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.

4 days ago

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

4 days ago

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.

4 days ago

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