Where I can find more info / doc about calling Python code from C#? #1688
Replies: 1 comment
-
I figure it out. Thanks. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I modified the sample code which has "def function():".
string name = "world";
var eng = IronPython.Hosting.Python.CreateEngine();
var scope = eng.CreateScope();
eng.Execute($@"
def greetings():
return 'Hello {name}'!'
greetings();
", scope);
dynamic greetings = scope.GetVariable("greetings");
var result = greetings( ); // this will crash.
Beta Was this translation helpful? Give feedback.
All reactions