Python ctypes 定義結構體時如何定義自身指針作爲屬性

因爲新的類 單元格在類語句本身中不可用。在ctypes中,我們可以 在類語句之後定義單元格類並設置_fields_屬性 類似這樣寫 #重構struct list_head結構體 (+pass 定義的時候另起一行) class list_head(ctypes.Structure): pass list_head.fields = [(「next」,POINTER(list_head)),(「pre
相關文章
相關標籤/搜索