ScriptEngine PythonEngine = Python.CreateEngine();
Scope = PythonEngine.CreateScope();
Point P = new Point(-1,1);
Scope.SetVariable("QWE", P);
PythonEngine.Execute("QWE.X = 0");
Console.WriteLine(P);
“UnboundNameException was Unhandled”
“global name ‘QWE’ is not defined”
I have no idea what this exception means, nor how to solve it, and I believe I’m doing something pretty simple… right?
Your engine is not tied to the scope. Change following line:
The error means that the variable “QWE” is not declared in code. It was due to the fact that engine wasn’t executing in the defined scope (where QWE was declared).
I’d recommend reading this link to get started with IronPython. They’ve got code examples and some explanations.