Thread overview | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
February 27, 2018 What's the latest news for calling D from python 3 using ctypes? | ||||
---|---|---|---|---|
| ||||
I am making a library that will run very speedily in D (or, failing that, C++) and do the backend work of a PyQt5 gui. Was wondering the simplest route to accomplish this, preferably in ctypes calls. Thanks. |
February 28, 2018 Re: What's the latest news for calling D from python 3 using ctypes? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Enjoys Math | On Tuesday, 27 February 2018 at 23:59:10 UTC, Enjoys Math wrote: > I am making a library that will run very speedily in D (or, failing that, C++) and do the backend work of a PyQt5 gui. Was wondering the simplest route to accomplish this, preferably in ctypes calls. > > Thanks. http://code.dlang.org/packages/pyd With PyD you can wrap the D functions for python instead of calling them through types in python. |
February 28, 2018 Re: What's the latest news for calling D from python 3 using ctypes? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Nicholas Wilson | On Wednesday, 28 February 2018 at 00:18:17 UTC, Nicholas Wilson wrote:
> On Tuesday, 27 February 2018 at 23:59:10 UTC, Enjoys Math wrote:
>> I am making a library that will run very speedily in D (or, failing that, C++) and do the backend work of a PyQt5 gui. Was wondering the simplest route to accomplish this, preferably in ctypes calls.
>>
>> Thanks.
>
> http://code.dlang.org/packages/pyd
>
> With PyD you can wrap the D functions for python instead of calling them through types in python.
Thank you! That looks like what I need. How do you install pyd with dub so that I can import ?
dub fetch pyd
dub run pyd
doesn't work. Will try other params and get back to this thread.
|
February 28, 2018 Re: What's the latest news for calling D from python 3 using ctypes? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Enjoys Math | Got it. dub init myproject from within my python frontend source dir will create a subdirectory. |
February 28, 2018 Re: What's the latest news for calling D from python 3 using ctypes? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Enjoys Math | On Wednesday, 28 February 2018 at 01:10:36 UTC, Enjoys Math wrote:
> Got it.
>
> dub init myproject
>
> from within my python frontend source dir will create a subdirectory.
Then you do
dub generate visuald
from within the subdir myproject.
|
February 28, 2018 Re: What's the latest news for calling D from python 3 using ctypes? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Enjoys Math | Can't build now: ------ Build started: Project: categorytheorybackend, Configuration: debug Win32 ------ Building C:\MyProjects\___ENJOYS_MATH\CategoryTheoryFrontend\CategoryTheoryBackend\categorytheorybackend.exe... Error: Error writing file 'obj\debug\dummy\dummy\dummy\dummy\dummy\categorytheorybackend\..\..\..\..\..\Users\FruitfulApproach\AppData\Roaming\dub\packages\pyd-0.9.9\pyd\infrastructure\deimos\python\abstract_.obj' Building C:\MyProjects\___ENJOYS_MATH\CategoryTheoryFrontend\CategoryTheoryBackend\categorytheorybackend.exe failed! Details saved as "file://C:\MyProjects\___ENJOYS_MATH\CategoryTheoryFrontend\CategoryTheoryBackend\.dub\obj\debug\dummy\dummy\dummy\dummy\dummy\categorytheorybackend\categorytheorybackend.buildlog.html" ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== |
February 28, 2018 Re: What's the latest news for calling D from python 3 using ctypes? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Nicholas Wilson | On Wednesday, 28 February 2018 at 00:18:17 UTC, Nicholas Wilson wrote:
> On Tuesday, 27 February 2018 at 23:59:10 UTC, Enjoys Math wrote:
>> I am making a library that will run very speedily in D (or, failing that, C++) and do the backend work of a PyQt5 gui. Was wondering the simplest route to accomplish this, preferably in ctypes calls.
>>
>> Thanks.
>
> http://code.dlang.org/packages/pyd
>
> With PyD you can wrap the D functions for python instead of calling them through types in python.
How would you get VisualD + PyD to work nicely together? See my failed build post above.
|
February 28, 2018 Re: What's the latest news for calling D from python 3 using ctypes? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Enjoys Math | On Wednesday, 28 February 2018 at 01:19:25 UTC, Enjoys Math wrote:
> Can't build now:
>
>
> ------ Build started: Project: categorytheorybackend, Configuration: debug Win32 ------
> Building C:\MyProjects\___ENJOYS_MATH\CategoryTheoryFrontend\CategoryTheoryBackend\categorytheorybackend.exe...
> Error: Error writing file 'obj\debug\dummy\dummy\dummy\dummy\dummy\categorytheorybackend\..\..\..\..\..\Users\FruitfulApproach\AppData\Roaming\dub\packages\pyd-0.9.9\pyd\infrastructure\deimos\python\abstract_.obj'
> Building C:\MyProjects\___ENJOYS_MATH\CategoryTheoryFrontend\CategoryTheoryBackend\categorytheorybackend.exe failed!
> Details saved as "file://C:\MyProjects\___ENJOYS_MATH\CategoryTheoryFrontend\CategoryTheoryBackend\.dub\obj\debug\dummy\dummy\dummy\dummy\dummy\categorytheorybackend\categorytheorybackend.buildlog.html"
> ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
For some reason, idk why, PyD is a dub source dependency (as opposed to a library). If you add \path\to\pyd to the include directory(?) dub variable (or -I\path\to\pyd to dmd/ldc/gdc) it should hopefully work.
|
February 28, 2018 Re: What's the latest news for calling D from python 3 using ctypes? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Nicholas Wilson | >> ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== > > For some reason, idk why, PyD is a dub source dependency (as opposed to a library). If you add \path\to\pyd to the include directory(?) dub variable (or -I\path\to\pyd to dmd/ldc/gdc) it should hopefully work. Seems like it already is. In VisualD compiler settings / additional import paths it's set to: "..\source" "..\..\..\..\..\Users\FruitfulApproach\AppData\Roaming\dub\packages\pyd-0.9.9\pyd\infrastructure" |
February 28, 2018 Re: What's the latest news for calling D from python 3 using ctypes? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Enjoys Math | On Wednesday, 28 February 2018 at 17:34:49 UTC, Enjoys Math wrote:
>>> ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
>>
>> For some reason, idk why, PyD is a dub source dependency (as opposed to a library). If you add \path\to\pyd to the include directory(?) dub variable (or -I\path\to\pyd to dmd/ldc/gdc) it should hopefully work.
>
> Seems like it already is. In VisualD compiler settings / additional import paths it's set to:
> "..\source" "..\..\..\..\..\Users\FruitfulApproach\AppData\Roaming\dub\packages\pyd-0.9.9\pyd\infrastructure"
Solution: Use C++ instead.
|
Copyright © 1999-2021 by the D Language Foundation