[IronPython] Help with Ops.GetAttr
sls at iinet.net.au
Tue Feb 12 14:30:02 CET 2008
I'm attempting to get an attribute from python object from C# using a
method like this:
public object GetAttr(object pyObject, string name)
ICallerContext context = _pythonEngine.DefaultModule as ICallerContext;
object value = Ops.GetAttr( context, pyObject,
where _pythonEngine is a PythonEngine object, pyObject is a python
object and name is the attribute I want to get.
According to other posts I've seen, this should work, but the first line
sets context to null. How to I get a valid context?
It seems every way I've read about to get the context
(DefaultContext.Default, GetModuleScope) is private, and therefore
I'm using IPY 1.1.1
More information about the Ironpython-users