I wrote code for my game, which should run the function of my Python code. I am using Ironpython for my project. However, when I try to use C # dynamic typing to call a function in the code below, it compiles, but I get the following error from Internals:
"Assets / scripts / WordSearchAlgorithm.cs (37.29): error CS1502: Best method overloaded method for
System.Runtime.CompilerServices.CallSite, object →. Create (System.Runtime.CompilerServices.CallSiteBinder)" has some invalid arguments for "
Assets
/ scripts/WordSearchAlgorithm.cs( 37,29): error CS1503: argument '# 1' cannot convert the expression 'object' to type 'System.Runtime.CompilerServices.CallSiteBinder' "" Assets / Scripts / WordSearchAlgorithm.cs (37 , 61): error CS0234: The type
or name of the namespace "RuntimeBinder" does not exist in the namespace
`Microsoft.CSharp". Are you missing an assembly link? "
Assets / scripts / WordSearchAlgorithm.cs (37.61): error CS1502: best version overloaded method matching for 'System.Runtime.CompilerServices.CallSite> .Create (System.Runtime.CompilerServices.CallSiteBinder)' has some invalid arguments
I think mono does not support this. Could you give me a solution to help me?
static public void StartSearchAlgorithm()
{
List < string > myList = new List < string > ()
{
"fxie",
"amlo",
"ewbx",
"astu"
};
var ironPythonRuntime = Python.CreateRuntime();
try
{
dynamic loadIPython = ironPythonRuntime.UseFile("C:/py.py");
loadIPython.BoggleWords(myList, loadIPython.MakeTrie("C:/words.txt"));
}
catch (FileNotFoundException ex)
{}
}
source
share