calling python from C#...

M

Mr BigSmoke

Hi everybody,
I need write an application in c#, but i wnat to use some functions
that i have already written in python. Is there an "easy" way to call
my python code from c#? I must use COM or there are other ways? And, if
COM is the only way, where can i find some tutorials or examples? I've
never wrote com server and i really don't know where and how to
start....
tnx
Fabio
 
J

Jens Theisen

There is IronPython which compiles to .NET. And there was another project
bridging the .NET runtime with the standard Python interpreter of which I
forgot the name.

Jens
 
R

Ravi Teja

Writing COM Servers is not hard
http://www.python.org/windows/win32com/QuickStartServerCom.html

IronPython is the other way.

Choose COM Server approach if you are using the a lot of standard
library functions (as I recall IronPython is not complete here, yet).
Definitely choose this approach if you are using C extensions to
Python.

IronPython is good for simpler Python tasks at this moment. Expect this
to change in the future. Of course, there is always XML-RPC, SOAP,
CORBA etc for language independence if you don't mind Client/Server
setup.

You can also write code in C# and drive it from Python. Check Python
for .NET.
 
M

Mr BigSmoke

I use python for .NET in some applications... I've always used it for
using c# code from python (but i had some problems using it with py2exe
and win2000). I'll try using it the other way (c# calling python).
I also thought about trying ironpython, but it's too young for my work
projects...
The COM aproach seemed more stable to me.... what do u think?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,066
Latest member
VytoKetoReviews

Latest Threads

Top