Gthoma2
Gthoma2

Reputation: 707

How to read content of .dll libraries as Python code

I am developing some visualization apps using an open-source framework called Omegalib:

https://code.google.com/p/omegalib/

This framework was originally written in C++ but has since incorporated Python versions of the C++ libraries. All of the pre-compiled python modules for Omegalib are provided as dynamic link libraries.

I would love to add some code-completion to my development environment as well as some stronger debugging capabilities than IDLE. In order to do this I need to provide the Python Omegalib libraries to whatever IDE I am using.

I've asked the developer if he knows how to achieve this and according to him, "...The reason is that omegalib python modules are not written in python, but in C++, and since I'm using an embedded interpreter there is no easy way (that I'm aware of, at least) to read the Python version of the modules".

So does anyone know how I can read in the .dll module files as Python code?

Thank you!

Upvotes: 0

Views: 464

Answers (1)

dfanz0r
dfanz0r

Reputation: 28

You can use ctypes to interface with a library if it has a c api.

However if it only has a C++ api, your only options are with a c extension module. Now there is cython to help with that which supports c and c++. It makes c extensions easier to write via python-like language.

Upvotes: 1

Related Questions