Using enums in ctypes.Structure

前端 未结 2 1067
刺人心
刺人心 2020-12-03 18:07

I have a struct I\'m accessing via ctypes:

struct attrl {
   char   *name;
   char   *resource;
   char   *value;
   struct attrl *next;
   enum batch_op op;         


        
2条回答
  •  清歌不尽
    2020-12-03 18:24

    Using c_int or c_uint would be fine. Alternatively, there is a recipe in the cookbook for an Enumeration class.

提交回复
热议问题