How to call functions inside a function in Python?

How can I call functions in Mono (.NET) libraries from Python?

  • I have a third-party C# .dll I would like to call from python (without running python inside Mono ala Python for .NET).  The host OS is Ubuntu, and I have installed the mono-runtime.  Are there more direct alternatives to an os-based call ala os.system()?  Note that IronPython's "mono python.exe" will not work for me.

  • Answer:

    You can use protocol buffers. There is a third party addon that supports C# (http://code.google.com/p/protobuf-net/).

Tudor Achim at Quora Visit the source

Was this solution helpful to you?

Other answers

Check out PythonNet - http://pythonnet.sourceforge.com/

Benjamin Burns

Mono is very easy to embed. You should be able to do that with ctypes. Look at the official wiki for an example of how embedding works: http://www.mono-project.com/Embedding_Mono

Armin Ronacher

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.