[IronPython] C# and IronPython Interface.

Kaveripakam, Sathish Sathish.Kaveripakam at phonak.com
Mon Nov 26 17:00:40 CET 2007

HI All,
I have c#  code which should call a Iron Python function. I am using
Iron python 1.1 version and Visual Studio 2005. The details of my files
are as follows:
 C# code (Entry.cs):
using System;

using System.Collections;

using IronPython.Hosting;

public class Entry


            public static void Main(string[] args)


                        int a= 2, b= 4;

                        // OVER HERE I WOULD LIKE TO CALL IRONPYTHON
Function: ArithmeticOperations which takes arguments a,b



PYTHON SCRIPT(ArithmeticOperations.py):

def ArithmeticOperations( a,b):

print "I am in ArithmeticOperation functions..."

return  a+b


In my project setup, I gave reference to include : IronPython, IronMath

In this regard, please do let me know, how to call the python script
"Arithmetic Operations" from my Entry.cs file ? Also, please do let me
know, if I have to include any of the libraries ?






Legal Notice: 
The information in this electronic transmission may contain confidential or
legally privileged information and is intended solely for the individual(s)
named above. If you are not an intended recipient or an authorized agent,
you are hereby notified that reading, distributing, or otherwise
disseminating, copying or taking any action based on the contents of this
transmission is strictly prohibited. Any unauthorized interception of this
transmission is illegal under law. If you have received this transmission in
error, please notify the sender by telephone [at the number indicated above/
on +41 58 928 0101] as soon as possible and then destroy all copies of this
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20071126/c7e8c95f/attachment.html>

More information about the Ironpython-users mailing list