How to Solve NameError: name 'wintypes' is not defined -- ctypes

Solution: Import the 'wintypes' module

To Solve the error, add the following line to the top of your code.

from ctypes import wintypes

 

For more information:
Python ctypes wintypes