Skip to content Skip to sidebar Skip to footer

Ctypes: Cannot Import Windll

I am running Python 2.7 32bits (Anaconda) on Windows 7 64bits. I would like to use ctypes to do win32 API calls, and I have a very weird issue: I can import ctypes, but not import

Solution 1:

It appears you cannot just import ctypes.windll, you need to import ctypes and then use ctypes.windll. I discovered that by printing all properties of ctypes:

import ctypes
printdir(ctypes)

What's also interesting is that IPython autocompletion was misleading here, because it didn't show windll as a possible choice when TAB-autocompleting after import ctypes..

Post a Comment for "Ctypes: Cannot Import Windll"