digitalmars.D.learn - Python <==> d call both ways example (with PyD and autowrap)?
- mw (7/7) Jun 22 2022 Hi,
- Marvin (3/10) Jun 22 2022 I would also really like an example. Because it would be great to
- Tejas (4/11) Jun 22 2022 IIRC the best you can do is embed a Python interpreter inside a D
- mw (6/9) Jun 22 2022 Thanks. I tried something like this:
- Jordan Wilson (6/13) Jun 22 2022 When I did something like this, I used this as my inspiration:
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.
Jun 22 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.
Jun 22 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
Jun 22 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.htmlThanks. 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.
Jun 22 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
Jun 22 2022