我的最终目标是在python中查询NVAPI的gpu使用情况和其他统计信息。见http://developer.nvidia.com/nvapi帮助python ctypes和nvapi
from ctypes import WinDLL
nvapi = WinDLL("nvapi.dll")
print nvapi# <WinDLL 'nvapi.dll', handle 718a0000 at 27c0050>
print nvapi.nvapi_QueryInterface# <_FuncPtr object at 0x026D8E40>
print nvapi.nvapi_QueryInterface()# returns 0
print nvapi.NvAPI_Initialize# AttributeError: function 'NvAPI_Initialize' not found
print nvapi.NvAPI_SYS_GetChipSetInfo# AttributeError: function 'NvAPI_SYS_GetChipSetInfo' not found
这是可以从上面的链接下载头文件的副本:http://paste.pound-python.org/show/7337/
在这一点上,我只是想用API来自己熟悉...所以我是什么我做错了?我无法弄清楚如何调用头文件中列出的任何函数。
我在这里发布了一个后续问题:http://stackoverflow.com/questions/6165628/use-python-ctypes-to-interface-with-nvapi-follow-up-with-demonstration-code – user319862 2011-05-29 02:32:30