Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from ctypes import Structure, c_void_p
- class FSCRT():
- class FONT(Structure):
- _fields_ = [('pData', c_void_p),]
- def __del__(self):
- print("font release")
- fscrt = FSCRT()
- class FSPDF():
- class TEXTSTATE(Structure):
- _fields_ = [("font", fscrt.FONT),]
- def __str__(self):
- return "TEXTSTATE {font: %s}" % self.font
- fspdf = FSPDF()
- state = fspdf.TEXTSTATE()
- state.font = fscrt.FONT()
- input(state)
- -------OUTPUT-------
- font release
- font release
- TEXTSTATE {font: <__main__.FSCRT.FONT object at 0x0000000002AD1BC8>}
Advertisement
Add Comment
Please, Sign In to add comment