hi all
I have a program in c# which hosts IronPython scripts. I set a variable in
SysModule using this:
Dictionary<String, Object> options = new Dictionary<String, Object>();
options.Add("ShowClrExceptions", true);
options.Add("ExceptionDetail", true);
options.Add("Debug", true);
ScriptEngine _scriptEngine = Python.CreateEngine(options);
ScriptScope _scriptScope = _scriptEngine.CreateScope();
ScriptScope sysScope = scriptEngine.GetSysModule();
sysScope.SetVariable("mySysVar", true);
_scriptEngine.ExecuteFile("something.py", _scriptScope);
Now, I want to read variable "mySysVar" from inside the script "something.py".
How can I do that?
I tried
------------
import sys
if sys.mySysVar:
...
-------------
and also
-------------
sys["mySysVar"]
-------------
but they don't work.
Thanks in advance
Ernesto Cullen
_______________________________________________
Users mailing list
[email protected]
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com