vendredi 12 août 2016

How to make python work with c# methods with optional params

I am working on a project where the applications use python and PyQt for front-end, and the backend is written in C#. I defined some methods in C#:

public void methodA(int param1, int param2=0,int param3=5){
    // some code
}

But when calling it from Python:

methodA(param1)

I get the error message: "No method matches given arguments". I understand that it has to do somehow with reflection.

My question is:
1. Is there any other way except: calling the method( in Python) like this: methodA(param1,0,5) or using reflection
2. If not, what needs to be done to enable this to work via reflection.





Aucun commentaire:

Enregistrer un commentaire