I need to program VIX API of VMware. It´s a dll wrote with C functions…
I want program in python calling this functions using ctypes and I don´t understand the documentation of ctypes in python web page…
Can someone give some samples with how to do this????
Thanks,
I’ve been meaning to do something like this for a while. I downloaded the VIX API kit, and extracted the vix.h file, containing all of the VIX API function prototypes. I then wrote a short pyparsing parser to extract the typedefs and function declarations, and convert them to ctypes definitions. With these definitions, you’ll be able to invoke the VIX methods from the VIX dll (the lib’s are not needed, only the dll is used by ctypes).
Extract this code to a suitably-named Python module (vixlib.py, for instance), and then import this module into any Python script to use VIX: