[IronPython] Assemblies loaded by default

Curt Hagenlocher curt at hagenlocher.org
Mon Feb 4 06:38:57 CET 2008


When I run IronPython interactively, I automatically get System.dll loaded:

PS f:\IronPython-2.0A8> *.\ipy.exe*
IronPython 2.0 Alpha (2.0.0.800) on .NET 2.0.50727.1433
Copyright (c) Microsoft Corporation. All rights reserved.
>>> *import System*
>>> *System.DateTime*
<type 'DateTime'>
>>>

But when I run an IronPython script through the hosting api, I don't:

C# source contains:
SourceUnit source = PythonEngine.CurrentEngine.CreateScriptSourceFromFile("
Class1.py");
IScriptScope m = PythonEngine.CurrentEngine.CreateScope();
PythonEngine.CurrentEngine.Execute(m, source);

 Class1.py contains:
import clr
import System
Output is:
IronPython.Runtime.Exceptions.ImportException : No module named System

What do I need to do to my embedding host to make sure it's preloading the
same assemblies as the interactive console?

--
Curt Hagenlocher
curt at hagenlocher.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20080203/04a4f7bc/attachment.html>


More information about the Ironpython-users mailing list