I have two files, a regular python (.py) file and a visual studio C# file (.cs). I want to use a function in the python file which returns a string and use that string in the C# file.
#This is the Python file!
return "Some String"
//This is the C# file!
string whatever = pythonString(); // This is from the Python file.
Check out IronPython! :)
Hope this helps, it's pretty ez ;)
var ipy = Python.CreateRuntime(); dynamic test = ipy.UseFile("Test.py"); test.pythonString(); //python-function to execute
just replace "pythonString()" with your function (already did this).