如何加载一个C#DLL中的蟒蛇? [英] How to load a C# dll in python?
问题描述
我怎么能在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
这篇关于如何加载一个C#DLL中的蟒蛇?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!