[IronPython] Calling a method with arguments from C#

Brandon Furtwangler furtwan1 at msu.edu
Fri Jan 6 19:08:21 CET 2006


Is it possible to call a python method from C# and pass C# variables as the
arguments?  For example py:

def Method3(person):

            return person.name

 

If so how do I call this from C# passing in some C# variable as person?

 

I'm thinking it should be something like:

pythonEngine.Evaluate("Method3({1})", myPerson);

In other words, I'd expect an overload of Evaluate to act as
Console.WriteLine and do whatever magic is required to link up the
variables.

Ideas? Comments?

 

-Brandon Furtwangler

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20060106/0587bed8/attachment.html>


More information about the Ironpython-users mailing list