Closed zeugmato closed 3 years ago
You can check out the source code of Numpy.NET which calls numpy in Python and passes data in and out. Also check out the documentation of pythonnet.
By myself I create a lazy method: define a function in a1.py file , e.g., def test(), this function has a return value, then import the a1, call the test() function directly:a1.test() .It worked!
great. then I can close this.
I noticed the two way: "dynamic" key words and "PythonEngine.Exec( )" function,but if I have hundreds lines of python codes to excute,there are countless "if else" and "class " and other functions, obviously the two above ways are not suitable. So how to pass some values to c#?And how to pass some values from c# to python codes?