I have the following python class:
class Header: id len def __init__(self, id, len): self.id = id self.len = len h = Header(1, 10)
How can I convert/encode an instance of this class,
bytearray, which can be written, for example to a
To give a little more perspective I need to write this object to an unix domain socket where a C program is listening to receive the above object (it defines the above
struct exactly as above, with same number/type of fields). Encoding by
pickle.dump(...) does not work.