[IronPython] register module with an IronPython engine

Fredrik Lundh fredrik at pythonware.com
Mon Oct 23 08:43:40 CEST 2006


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



More information about the Ironpython-users mailing list