Hi,
I have a class in .NET (C#):
public class MyHelper {
public object exec( string script, params object[] arguments ) {
// execute script with passed arguments in some external enviroment
}
}
I'm using IronPython runtime in my code to run python scripts, which should in some cases call the "exec" method. I would like serve the comfortable way to call the "exec" method. Something like:
helper.exec( "someExternalFunction( {0}, {1}, {3} )", var01, var02, var03 )
But I don't know how to declare the "exec" method in C# to achieve this. In python I can use a "*args" argument:
def exec( script, *args ):
... do something ...
I don't want have separate Python method "exec" from "MyHelper" class, because the "MyHelper" class provides complex functionality "in one place".
How should I write the "exec" method declaration in C# to achieve that? Or what other solution should I use?
Thanks