I'm attempting to call a C# function from a Python script, via the clr
module from the PythonNet
library.
One of the arguments that this C# function takes is of the type System.Collections.Generic.IEnumerable
. Simply supplying a list of the required data types to the first argument results in a 'list' value cannot be converted to 'System.Collections.Generic.IEnumerable'
error.
After searching online, the supposed .NET datatypes should already be included in the Python installation, and I should be able to access them. However, I'm unsure as to how.
Doing:
from System.Collections.Generic import *
Fails because the module isn't found, while doing:
import collections
Doesn't have a namespace IEnumerable
.
How would I go about converting a Python list to the System.Collections.Generic.IEnumerable
data type?
Thanks for reading my post, any guidance is appreciated.