111,129
社区成员
发帖
与我相关
我的任务
分享
string py = @"
print x;";
ScriptEngine engine = Python.CreateEngine();
ScriptSource code = engine.CreateScriptSourceFromString(py, SourceCodeKind.Statements);
ScriptScope scope = engine.Runtime.Globals;
scope.SetVariable("x", 123);
code.Execute();