[IronPython] How to load built-in models.

Han Kejing Colin.Han at grapecity.com
Sun Jul 13 11:39:45 CEST 2008


Hi, all,

I was write follows code in my WinForm application. But I got an
SyntaxErrorException "unexpected token 'print'".

 

            ScriptRuntimeSetup runtimeSetup = new
ScriptRuntimeSetup(true);

            this._runtime = ScriptRuntime.Create(runtimeSetup);

            this._engine =
this._runtime.GetEngine(typeof(PythonContext));

            this._scope = this._engine.CreateScope();

 
_engine.CreateScriptSourceFromString("print(\"test\")").Execute(_scope);

 

I think maybe the built-ins modules is not loaded in my code.

How to load it? Thanks.

 

----------------------------------------------------------------

Do ONE thing, and do it WELL.

 

Colin Han @ GrapeCity

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20080713/f109f671/attachment.html>


More information about the Ironpython-users mailing list