[IronPython] How do I import SourceCodeKind enumeration?

Dan Eloff dan.eloff at gmail.com
Mon Apr 21 07:03:08 PDT 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)

Thanks,
-Dan


More information about the Users mailing list