Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from ctypes import Structure, c_void_p
- class FONT(Structure):
- _fields_ = [('pData', c_void_p),]
- def __del__(self): print("release font", self)
- class SETTINGS(Structure):
- _fields_ = [("font", FONT),]
- def setFont():
- settings = SETTINGS()
- f = FONT()
- settings.font = f
- print(settings.font)
- print(settings)
- setFont()
- ----------------------
- <__main__.FONT object at 0x0000000004495948>
- release font <__main__.FONT object at 0x0000000004495948>
- <__main__.SETTINGS object at 0x00000000044958C8>
- release font <__main__.FONT object at 0x0000000004495848>
Advertisement
Add Comment
Please, Sign In to add comment