IronPythonスコープ内の変数の値をC#のNoneに設定するには、ScriptEngine.ExecuteAndWrap("x = None", scope)
を使用せずにScriptScope.SetVariable
を使用しますか?変数は既にScriptEngine/ScriptScope内で定義されている必要がありますか?この例では動作しませんでした:IronPython変数をNoneに設定する
// Note: "scope" is the ScriptScope variable assigned beforehand
scope.SetVariable("x", null);
ウェブ検索では、この関連リンクを見つけたが、それは解決策を提供していませんでした:
http://lists.ironpython.com/pipermail/users-ironpython.com/2009-June/010605.html
varは必ずしもSetVariableを呼び出す前にスコープ内に存在する必要はありません。 –