This post in Mike Stall's blog states that
The last expression result is stored as the global variable
"_"
, so you can retrieve it like so:object o = m_python.GetVariable("_");
But currently in v2 scope has no such variable after executing, e.g.,
scriptEngine.CreateScriptSourceFromString("a=1+2;a+1", SourceCodeKind.Statements);
Is there any way to access result (a+1)
without explicitly define variable?