Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

There are some great libraries for Python that have cousins in the .NET world, but some are unmatched.

Realizing that Python is a dynamic language, which makes it difficult to mix with a (largely) statically typed language like C# (though this is seemingly getting easier with .NET 4.0), there are options like IronPython which can help match up the two languages.

I've never come across any other options for dovetailing Python libraries with .NET. Are there any other ways to do this that are tried and true? I have far less experience with Python, so it's entirely possible that I'm overlooking something.

share|improve this question
add comment

4 Answers

up vote 3 down vote accepted

Providing your use case isn't dependent on speed you can use things like .net remoting and XML services to allow different platforms/languages/environments to talk to each other (this is the approach used by the Robot Framework RemoteLibrary for example).

Another option is to have some common data store behind both languages (typically a database).

share|improve this answer
    
The remoting is one I definitely hadn't thought of. –  jonsca Oct 24 '11 at 14:12
add comment

Our application shells out to run python. We had to do that instead of using IronPython because a number of the base libraries are compiled from C. A simple test for determining what you'll have to do is to parse a CSV file.

share|improve this answer
add comment

I'm not saying I recommend this approach, but in the spirit of completeness, you could use COM to invoke Python from .NET or visa versa. I have never used COM with Python but apparently it is possible.

share|improve this answer
add comment

IronPython tries the total integration approach. There is a package called Python.NET that is a hybrid of the CLR and the standard C based Python runtime. It seems less developed than IronPython and I'm not sure it would be ".NET" enough. However, it would give direct access to Python libraries.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.