Evaluate can only parse expressions, not statements (and print is a statement). If you have a statement you'd like to Execute you should use the Execute function on the engine instead.
These correspond w/ Python's exec statement and the eval built-in function. Do you want to help develop Dynamic languages on CLR? (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038) -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of JoeSox Sent: Friday, March 03, 2006 1:07 PM To: Discussion of IronPython Subject: [IronPython] unexpected token print at <string>:1 Can someone explain why I get this error when calling: .... tempobject = (object)global_eng.Evaluate("print \"hello\""); .... --- >>>print "hello" unexpected token print at <string>:1 ---- I've tried stepping thru: public static object eval(ICallerContext context, string expression) { return eval(context, expression, globals(context)); and I just don't understand why it doesn't return "hello" Thanks. -- Joseph _______________________________________________ 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
