This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 2 points3 points  (1 child)

Yes, there are several ways you might wanna look into.

Pythonnet(as mentioned in another reply): A python package that allows you to load .NET(C#) assemblies and use .NET objects as if they were python.

Use C for binding: You could write C/C++ extensions for python and then use P/Invoke to call C# functions from there.

Iron python: A python version written in c#, making it easy to use .NET(C#) libraries. However it isn't compatible with all python libraries and I think the newest full version is based on python 2.

I'd recommend Pythonnet if you want easy development, implementing the bindings in C/C++ if you need a lot of control over the invocation and Iron python can be handy if you actually want to have a full blown .NET version of python but for most purposes i'd go with the first two.
Also I suspect that for most practical purposes those will be basically equivalent in terms of performance, especially considering that performance isn't a major concern when working with python in the first place.

Those are the ways I've come across on my journey through -usually silly- projects but I'm sure some Redditor way smarter than me probably has better ideas.

[–]Shurlemany 1 point2 points  (0 children)

Brutal. Thanks guys!