[IronPython] How do I import SourceCodeKind enumeration?

Dan Eloff dan.eloff at gmail.com
Mon Apr 21 16:03:08 CEST 2008

Using the source code for the DLR I've discovered that SourceCodeKind
lives in Microsoft.Scripting, (and is public) but...

>>> clr.AddReference('Microsoft.Scripting')
>>> from Microsoft.Scripting import SourceCodeKind
Traceback (most recent call last):
  File , line unknown, in Initialize##366
ImportError: Cannot import name SourceCodeKind

How do I import it? Can you import enumerations?

I need it for Engine.CreateScriptSourceFromString(str code, SourceCodeKind kind)


More information about the Ironpython-users mailing list