s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((host, port))
senddata = '?status'
query = '\x00\x83' + struct.pack('>H', len(senddata) + 6
    ) + '\x00' * 5 + senddata + '\x00'
s.send(query)
data = s.recv(1024)
print(repr(data))
PHP and Python unpack return different results from same source