implemented read/write for python packets/messages