Can python load definitions from a C header file?
问题 I'm writing a python Wrapper around a C API. I have an extensive API description and right now I'm struggling with the implementation of enums defined in the header file. Let's assume i have a C API function inside myAPI.dll , that accepts an enum as argument like: void SomeFunction(SomeEnum data) From the header file, I can see that SomeEnum looks like: enum SomeEnum{ SomeValue = 1, SomeOtherValue = 2, SomeVeryStupidValue = -1 }; In python, I load the .dll like: myAPI = ctypes.cdll