views:

639

answers:

1

I'm trying to import a Python module in a C# code like this:

        var setup = Python.CreateRuntimeSetup(null);
        var runtime = new ScriptRuntime(setup);
        var engine = Python.GetEngine(runtime);
        var module = engine.ImportModule("mymodule");

but I get an error saying "No module named signal", does this mean that IronPython just can't load the signal module, is it OS specific?

Can anyone think of a workaround?

+1  A: 

The 'signal' module is used to handle all that has to do with ... you guessed it: signals. There are special "messages" that the OS send to a process to tell it something: eg. Break, Kill, Terminate, etc... The exact set of message are generally OS specific, but as the signals python manual page states, python emulates BSD style interface, except for SIGCHLD.

Now, in CPython, the 'signal' module is a built-in as far as I can remember, it could possibly be that IronPython has not implemented it, in fact, a quick google and look on IronPython's site leads to this: IronPython and CPython differences (read it, in particular, the extension modules part!)

Possible workaround: edit your module not to use signals when in IronPython

Nico