Is there a better way to initialize a ctypes field that is meant to be static/constant than what I have below?
from ctypes import *
class foo(LittleEndianStructure):
_fields_ = [
("signature", c_ulonglong),
]
def __init__(self):
super(LittleEndianStructure,self).__init__()
self.signature = 0x896489648964
f = foo()
print hex(f.signature)
For example, I was hoping I could do something similar to how you could do it with a normal python object:
class bar:
signature = 0x896489648964
b = bar()
print hex(b.signature)