I have a class in .NET (C #):
public class MyHelper { public object exec( string script, params object[] arguments ) {
I use runtime in IronPython in my code to run python scripts, which in some cases should call the "exec" method. I would like to serve as a convenient way to call the exec method. Sort of:
helper.exec( "someExternalFunction( {0}, {1}, {3} )", var01, var02, var03 )
But I do not know how to declare the "exec" method in C # to achieve this. In python, I can use the argument "* args":
def exec( script, *args ): ... do something ...
I don’t want to have a separate Python method “exec” from the class “MyHelper”, because the class “MyHelper” provides complex functions in one place.
How do I write an "exec" method declaration in C # to achieve this? Or what other solution should I use?
thanks
source share