pyton in c#

using System;
using Python.Runtime;

class Program
{
    static void Main()
    {
        PythonEngine.Initialize();

        using (Py.GIL())
        {
            dynamic py = Py.Import("mymodule");
            dynamic result = py.add(5, 3);
            Console.WriteLine(result);
        }

        PythonEngine.Shutdown();
    }
}

Comments