[Ironpython-users] Calling Python function from C# with **args?

Jeff Hardy jdhardy at gmail.com
Wed Apr 17 17:42:42 CEST 2013


On Wed, Apr 17, 2013 at 7:00 AM, Doug Blank <doug.blank at 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.

- Jeff


More information about the Ironpython-users mailing list