I have a Python module, wrapper.py, that wraps a C DLL. The DLL lies in the same folder as the module. Therefore, I use the following code to load it:
wrapper.py
Expanding on Matthew's answer:
import os.path dll_name = "MyCDLL.dll" dllabspath = os.path.dirname(os.path.abspath(__file__)) + os.path.sep + dll_name myDll = ctypes.CDLL(dllabspath)
This will only work from a script, not the console nor from py2exe.
py2exe