calling python from C#...

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mr BigSmoke

    #1

    calling python from C#...

    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

  • Ravi Teja

    #2
    Re: calling python from C#...

    Writing COM Servers is not hard


    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.

    Comment

    • Mr BigSmoke

      #3
      Re: calling python from C#...

      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?

      Comment

      • Jens Theisen

        #4
        Re: calling python from C#...

        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

        Comment

        • Ravi Teja

          #5
          Re: calling python from C#...

          I actually find Python for .NET most convenient


          I did not try py2exe with these applications, so I cannot comment.

          Comment

          • Ravi Teja

            #6
            Re: calling python from C#...

            Python for .NET


            Comment

            Working...