Extending and Embedding

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Eduardo Rodrigues

    #1

    Extending and Embedding

    How can I load a module (written in C as a shared
    library (.so)) through "PyRun_SimpleSt ring"?

    I've tried "from <module> import *", but a got a
    message: ImportError: No module named <module>

    Thanks in advance.

    Erocha





    Yahoo! Mail - Com 250MB de espaço. Abra sua conta! http://mail.yahoo.com.br/
  • Diez B. Roggisch

    #2
    Re: Extending and Embedding

    Eduardo Rodrigues wrote:
    [color=blue]
    > How can I load a module (written in C as a shared
    > library (.so)) through "PyRun_SimpleSt ring"?
    >
    > I've tried "from <module> import *", but a got a
    > message: ImportError: No module named <module>[/color]

    You can't do this. You have to either wrap the module - which is possible in
    several ways, including hand-written code, pyrex, swig and sip. Maybe even
    more, I don't know.

    Or you access it using the module ctypes that allows to invoke arbitrary
    methods/funtctions of C-libs. google for it.
    --
    Regards,

    Diez B. Roggisch

    Comment

    Working...