[IronPython] Calling Methods from other Methods

Dave Fugate dfugate at microsoft.com
Thu Dec 21 01:32:35 CET 2006


Thanks Ken!

Looks like a bug to me and I've filed a CodePlex Work Item (see http://www.codeplex.com/IronPython/WorkItem/View.aspx?WorkItemId=6714).

-----Original Message-----
From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of kenj55
Sent: Tuesday, December 19, 2006 9:39 AM
To: users at lists.ironpython.com
Subject: [IronPython] Calling Methods from other Methods


Hi,

I'm having a problem calling one method from another when i run python
within the PythonEngine.

i.e. If I have the following code:

string functions = "def func1():\n\treturn \"hello\"\n\n";
functions += "def func2():\n\treturn func1()\n\n";
functions += "func2()";

pyEngine.Execute(functions, module, locals);

I get an error along the lines of:

IronPython.Runtime.Exceptions.PythonNameErrorException: name 'func1' not
defined



Does anyone have any ideas where I might be going wrong?

Cheers,
Ken
--
View this message in context: http://www.nabble.com/Calling-Methods-from-other-Methods-tf2847245.html#a7951284
Sent from the IronPython mailing list archive at Nabble.com.

_______________________________________________
users mailing list
users at lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com



More information about the Ironpython-users mailing list