You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm looking for an example to create a Python object on the D side, and call that object's member function also from D side.
I.e the D side holds a Python object, and call its method, may also pass in parameters using a D variable.
Is this possible? I checked the /examples dir, but didn't find clue how to do this.
The closest is pydobject/example.d, but it only get a PydObject ints (as list), and loop on it.
Ah, I just saw:
PydObject random = py_eval("Random()", "random");
random.method("seed", 234);
int randomInt = random.randrange(1, 100).to_d!int();
PydObject otherInt = random.randrange(200, 250);
it can pass string, and int to the PydObject, how to pass a D-array to PydObject?
Thanks.
The text was updated successfully, but these errors were encountered:
mw66
changed the title
any example to create a Python object on the D side, and call that object's member function?
any example to create a Python object on the D side, and call that object's member function passing a D array?
Oct 28, 2020
Hi,
I'm looking for an example to create a Python object on the D side, and call that object's member function also from D side.
I.e the D side holds a Python object, and call its method, may also pass in parameters using a D variable.
Is this possible? I checked the /examples dir, but didn't find clue how to do this.
The closest is pydobject/example.d, but it only get a PydObject ints (as list), and loop on it.
Ah, I just saw:
it can pass string, and int to the PydObject, how to pass a D-array to PydObject?
Thanks.
The text was updated successfully, but these errors were encountered: