loading Python20.dll during run-time under Windows

Paul Moore gustav at morpheus.demon.co.uk
Mon Mar 12 00:56:01 CET 2001

On 11 Mar 2001 02:32:45 GMT, zeitlin at seth.lpthe.jussieu.fr (Vadim
Zeitlin) wrote:

> Hello,
> I have an application which can use Python for scripting but it is not
>essential to its work, i.e. it works mostly fine without Python. So I'd
>like to be able to install it even on systems lacking Python installation
>but for this I need to [try to] load Python.dll during run-time instead
>of linking to it directly.
> Has anyone done this before and is there any (C) code I could reuse?

Look at the source code for Vim 6 (from ftp.vim.org, in
/pub/vim/unreleased/{unix,extra}). The latest versions have dynamic
loading of Python - it's in if_python.c. Basically, it's simple, but
tedious - load the DLL, and then get the addresses of all the
functions you want, casting to the appropriate signatures.


More information about the Python-list mailing list