title: How can I convert a C++ enum to ctypes.Structure using Python 2.7.2?
body: <p>I have searched and searched, but I haven't found an example that does what I need to do.<br>
  I found 
  <a href="https://stackoverflow.com/questions/36932/how-can-i-represent-an-enum-in-python">How can I represent an &#39;Enum&#39; in Python?</a> 
  here on SO, but it doesn't cover ctypes.Structure.
  I also found 
  <a href="https://stackoverflow.com/questions/1546355/using-enums-in-ctypes-structure">Using enums in ctypes.Structure</a>
  here on SO, but it includes pointers, which I am not familiar with.</p>
  
  <p>I have a header file that includes typedef enum, that I need to use in a ctypes.Structure in a Python file.</p>
  
  <p>C++ header file:</p>
  
  <pre><code>typedef enum {
  
          ID_UNUSED,
          ID_DEVICE_NAME,
          ID_SCSI,
          ID_DEVICE_NUM,
  } id_type_et; 
  </code></pre>
  
  <p>Python file (The way I am currently doing it):</p>
  
  <pre><code>class IdTypeEt(ctypes.Structure):
  
          _pack_ = 1
          _fields_ = [ ("ID_UNUSED", ctypes.c_int32),
              ("ID_DEVICE_NAME", ctypes.c_char*64),
              ("ID_SCSI", ctypes.c_int32),
              ("ID_DEVICE_NUM", ctypes.c_int32) ]
  </code></pre>
  
  <p>Any advice would be greatly appreciated.  The simpler, the better.</p>