<br><br><div><span class="gmail_quote">On 8/9/06, <b class="gmail_sendername">Albert Strasheim</b> <<a href="mailto:fullung@gmail.com">fullung@gmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Next caveat: on Windows, shared libraries aka DLLs, typically have a .dll<br>extension. However, Python extensions have a .pyd extension.<br><br>We have a utility function in NumPy called ctypes_load_library which handles
<br>finding and loading of shared libraries with ctypes. Currently, shared<br>library extensions (.dll, .so, .dylib) are hardcoded in this function.<br><br>I propose we modify this function to look something like this:<br>
<br>def ctypes_load_library(libname, loader_path, distutils_hack=False):<br>    ...<br><br>If distutils_hack is True, instead of the default mechanism (which is<br>currently hardcoded extensions), ctypes_load_library should do:
<br><br>import distutils.config<br>so_ext = distutils.sysconfig.get_config_var('SO')<br><br>to figure out the extension it should use to load shared libraries. This<br>should make it reasonably easy for people to build shared libraries with
<br>distutils and use them with NumPy and ctypes.</blockquote><div><br>Wouldn't it make more sense to just rename the .pyd generated by distutils to .dll or .so?  Especially since the .pyd generated by distutils won't actually be a python extension module.   This renaming could be automated by a simple python script that wraps distutils.  The addition of the init{modulename} function could also be done by that script.
<br><br>--bb<br></div><br></div>