On Wed, Apr 17, 2013 at 11:42 AM, Jeff Hardy <jdha...@gmail.com> wrote: > On Wed, Apr 17, 2013 at 7:00 AM, Doug Blank <doug.bl...@gmail.com> wrote: >> IronPython users, >> >> Is there a way to call a Python function or method defined like: >> >> def func(**args): >> return args >> >> from C#? > > PythonCalls.CallWithKeywordArgs should do what you want. If you don't > have a CodeContext handy you should be able to use > DefaultContext.Default.
Excellent... yes that worked! I can now call most Python code directly from our implementation of Scheme (and vice versa, with a CLR wrapper around our Scheme function calls). Here are a few more details in case someone needs them. Thanks for the quick and accurate help! -Doug retval = IronPython.Runtime.Operations.PythonCalls.CallWithKeywordArgs( IronPython.Runtime.DefaultContext.Default, proc, new object [2] { new int[2] {1, 1}, new int[2] {1, 1} }, new string [2] {"input", "output"}); > - Jeff _______________________________________________ Ironpython-users mailing list Ironpython-users@python.org http://mail.python.org/mailman/listinfo/ironpython-users