[python-win32] Loading a and running from a dll runtime?

Paul Moore p.f.moore at gmail.com
Thu May 11 12:25:41 CEST 2006


On 5/11/06, Andrew Markebo <andrew.markebo at comhem.se> wrote:
> My question is... Is it possible to load and execute the code in a dll
> from PythonWin?
>
> I have found the function LoadLibrary, but how do I check the
> contents, and so on in the dll?

I don't think this is possible within pywin32 (I'm sure Mark will
correct me if I'm wrong!)

> Or should I use swig or similar?

To do this at runtime, you might look at ctypes (which is at
http://starship.python.net/crew/theller/ctypes/, or if you wait for
Python 2.5, it will be in the standard library).

Swig allows you to build a wrapper around a DLL (pyrex can be used in
a similar manner), and is more of a "compile-time" approach.

Hope this helps.

Paul.


More information about the Python-win32 mailing list