如何加载一个C#DLL中的蟒蛇? [英] How to load a C# dll in python?

查看:243
本文介绍了如何加载一个C#DLL中的蟒蛇?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我怎么能在python加载一个C#DLL?

how can I load a c# dll in python?

我必须把一些额外的code在C#文件? (如出口在C ++中的文件)

Do I have to put some extra code in the c# files? (like export in c++ files)

我不希望使用IronPython的。我想导入一个模块,Python的!

I don't want to use IronPython. I want to import a module to Python!

推荐答案

这是回答你问题的第二部分 尝试使该DLL的COM可见。

This is to answer the second part of your Question Try making the DLL COM visible.

通过使用

[ComVisible(true)]

确定的IronPython是Python语言的.NET implemenatation  该技术是将使用.NET 4.0的DLR到达时将这样的IronPython有更多的活力(就是一个字)。 (英文,如果你是一个Python大师,你会当你使用IronPython的更有家的感觉)

Ok IronPython is a .net implemenatation of the Python language The technology is going to use the DLR of the .net 4.0 when it arrives so IronPython will have more Dynamism (is that a word). (In english if you're a Python guru, you'll feel more at home when you use IronPython)

所以,你可能选择IronPython的,如果你这样做,你可以跳过COM可见部分。由于两个(C#,Python的铁)的净下

So you may well choose IronPython, if you do that you can skip the COM visible part. Since both (C# , Iron Python) are under .Net

http://ironpython.net/

参观这里一个示例C#DLL是COM可见

这篇关于如何加载一个C#DLL中的蟒蛇?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆