May 14, 2019
On Monday, 13 May 2019 at 21:29:18 UTC, Danny Arends wrote:
>
> "ImportError: No module named 'stuff'"
>
> How do I make the py_import file from pyd find the stuff.py file ?
>

On Linux PYTHONPATH doesn't have current directory by default, so a hacky way to do it is to add it to PYTHONPATH prior to each run

    PYTHONPATH=. ./prog

More realistic solution of course is to add it before importing anything in your code

    void main()
    {
        py_stmts("import sys; sys.path += './'");
        ...
    }

Or alternatively set the environment variable from D

>
> ps. I removed the vs debugger stuff since I'm on Linux
>

It is cross platform, I just tested it myself and it works fine. You can mixed debugging D and Python is VS Code even on Linux.
May 14, 2019
On Monday, 13 May 2019 at 08:33:46 UTC, Russel Winder wrote:
>> I'd like to use D for the "brain" of a small robot (Anki vector)
>> whose API is coded in Python 3.6+.
>> I had a look at Pyd but it's limited to python 2.7...
>
> PyD works entirely fine for me using Python 3.7.
>

Yes, it seems to work so far for me too, just modifying the dub.json file.

Thank you all for the tips!!

May 19, 2019
On Monday, 13 May 2019 at 03:06:07 UTC, evilrat wrote:
> On Monday, 13 May 2019 at 01:35:58 UTC, evilrat wrote:
>>
>> I have project using pyd with python 3.7, that also using ptvsd (visual studio debugger for python package) to allow mixed debugging right inside VS Code.
>>
>> I'll reduce the code and upload somewhere later.
>>
>
> https://github.com/Superbelko/pyd-min
>
> Here. Super minimal example, ptvsd can be commented out as well, it is there entirely for debugging.

Your example helped me a lot!
Thank you evilrat!
1 2
Next ›   Last »