[IronPython] register module with an IronPython engine

Mark Rees mark.john.rees at gmail.com
Thu Oct 26 07:26:14 CEST 2006


I am sure that effbot (fredrik) understands how to do what DIno suggested,
but for those who do not or are interested, I have an example at
http://hex-dump.blogspot.com/2006/10/using-ironpythons-101-new-community.html

Regards

Mark

On 10/26/06, Dino Viehland <dinov at exchange.microsoft.com> wrote:
>
> You can apply the PythonModule to your assembly specifying the type that
> corresponds with the module type.  In 1.0.1 our site.py will load any DLLs
> in the "DLLs" directory and the module will be available for you to
> import.  The type that PythonModule references should be a static type (no
> instance members).
>
> -----Original Message-----
> From: users-bounces at lists.ironpython.com [mailto:
> users-bounces at lists.ironpython.com] On Behalf Of Fredrik Lundh
> Sent: Sunday, October 22, 2006 11:44 PM
> To: users at lists.ironpython.com
> Subject: [IronPython] register module with an IronPython engine
>
> how do I register a module with an IronPython engine, so that code that
> runs
> in that engine can do "import mymodule" and get a reference to the module
> I
> just added?
>
> In CPython, I can simply call Py_InitModule and pass in the module name
> and
> a pointer to an array of PyMethodDef structs. Surely there's a
> corresponding
> mechanism in IronPython? (preferrably taking a name and an object, or
> some-
> thing. And yes, engine.Globals.Add almost does what I want, but not
> quite.)
>
> cheers /F
> _______________________________________________
> users mailing list
> users at lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
> _______________________________________________
> users mailing list
> users at lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20061026/5332630e/attachment.html>


More information about the Ironpython-users mailing list