I’m trying to create a bunch of python functions from a windows dll, and would like to have docstrings attached to each new function.
My current code:
import ctypes
lib=ctypes.WinDLL('example.dll')
VCS_OpenDevice=lib['VCS_OpenDevice']
VCS_OpenDevice.restype=ctypes.c_double
When i run this script in my interpreter and try to use the function, I get the ‘no docstring’ message.
Can’t figure out to add something there. Any help is appreciated.

Assign to the
__doc__attribute ofctypesfunction pointers:__doc__is the docstring attribute of Python objects, andctypesobjects allow you to write to this attribute.Obligatory libc demonstration (I use Mac, not Windows, but the principle is the same):
IPython seems to be able to pick that up just fine: