I have seen documentation on the IronPython mailing list that describes how to write an extension module in c#. I’ve been able to follow the documentation and it works fine. However, does anyone know how to go about producing a hierarchical extension PACKAGE in c#? For instance you are supposed to do something like this for a module:
[assembly: PythonModule("my_module", typeof(test.MyModule))]
namespace test
{
public static class MyModule
{
public static void hello_world()
{
Console.WriteLine("hello world");
}
}
but how would you create a module called testme UNDER my_module that you would import like this:
from my_module import testme
A short example or a gentle push in the right direction would be wonderful!
PyCrypto uses .pyd files for its native code, which are in the same folder as the Python files. I don’t believe that IronPython supports that arrangement.
Ideally you only want to implement the native parts of PyCrypto so that you can leverage the existing Python package. One option could be to create a single module (say
IronPyCrypto) with the necessary classes and modify the__init__.pyfiles in PyCrypto to sayYou lose complete compatibility with the PyCrypto source, but at least it will work.