以下のコードを検討してください。
ScriptRuntimeSetup setup = Python.CreateRuntimeSetup(null);
ScriptRuntime runtime = new ScriptRuntime(setup);
ScriptEngine engine = Python.GetEngine(runtime);
ScriptScope scope = engine.CreateScope();
scope.SetVariable("message", "Hello, world!");
string script = @"print message";
ScriptSource source = scope.Engine.CreateScriptSourceFromString(script, SourceCodeKind.Statements);
source.Execute();
このコードでは、次の例外が発生します。
Microsoft.Scripting.Runtime.UnboundNameException は処理されませんでした Message="name 'message' is not defined"
私は何が欠けていますか?