By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,996 Members | 1,498 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,996 IT Pros & Developers. It's quick & easy.

Extending and Embedding

P: n/a
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/
Jul 18 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Eduardo Rodrigues wrote:
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.
--
Regards,

Diez B. Roggisch
Jul 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.