Thank you so much, it is working. ---------------------------------------------------------------- Follow my heart Colin Han @ MultiRow Developer Team (A Strong Team)
-----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Michael Foord Sent: 2008年7月13日 18:33 To: Discussion of IronPython Subject: Re: [IronPython] How to load built-in models. Han Kejing wrote: > > 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); > That last line should be: _engine.CreateScriptSourceFromString("print(\"test\")", SourceCodeKind.Statements).Execute(_scope); Michael > 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* > > ------------------------------------------------------------------------ > > _______________________________________________ > Users mailing list > [email protected] > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ _______________________________________________ Users mailing list [email protected] http://lists.ironpython.com/listinfo.cgi/users-ironpython.com _______________________________________________ Users mailing list [email protected] http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
