I have a python script that needs to do some communication with a C# function. The function expects three parameters, two of which are returned via the out
keyword. The declaration looks something like this:
RunComputation(InfoParams locInfo, out double[,] dataTable, out int numPoints){ ... }
Since Python is a dynamically typed language, it doesn't know how to deal with the out keywords. I did some searching and found some stuff about clr.StrongBox and clr.Reference, which seem fairly simple to use in situations where you need to pass a strongly typed object.
For the numPoints parameter, I can define something like this in the python code:
num_points = clr.Reference[int]
And it seems to be fine. The problem comes from the dataTable array. I don't know the syntax to tell it that my strongly typed object is an array of doubles. The error it gives informs me that it's expecting an instance of Type StrongBox[Array[float]]
. I tried import Array from System to see if I could add that C# type in as a reference, but it failed. Any ideas?