Extending and Embedding

E

Eduardo Rodrigues

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

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/
 
D

Diez B. Roggisch

Eduardo said:
How can I load a module (written in C as a shared
library (.so)) through "PyRun_SimpleString"?

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

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top