从python调用C#库

任何人都可以分享一个有效的示例,说明如何从python代码调用简单的C#库(实际上是其WPF)?(我曾尝试使用IronPython,但在使用不受支持的CPython库(我的python代码正在使用中遇到太多麻烦,因此我想到了另一种尝试并从Python调用我的C#代码)。


这是我玩的示例:


using System.Runtime.InteropServices;

using System.EnterpriseServices;


namespace DataViewerLibrary

{

    public interface ISimpleProvider

    {

       [DispIdAttribute(0)]

       void Start();

    }


    [ComVisible(true)]

    [ClassInterface(ClassInterfaceType.None)]

    public class PlotData : ServicedComponent, ISimpleProvider

    {

       public void Start()

       {

          Plot plotter = new Plot();

          plotter.ShowDialog();

       }

    }

}

绘图仪是绘制椭圆的WPF窗口


我不知道如何从我的python全部调用此代码。有什么建议么?


噜噜哒
浏览 1188回答 3
3回答
打开App,查看更多内容
随时随地看视频慕课网APP