public Message(String content) {
length = new int[]{calcMessageLength(content), 0x00, 0x00, 0x00};
code = new int[]{calcMessageLength(content), 0x00, 0x00, 0x00};
magic = new int[]{0xb1, 0x02, 0x00, 0x00};
this.content = content;
end = new int[]{0x00};
}
`
Message{length=[173, 0, 0, 0], code=[173, 0, 0, 0], magic=[177, 2, 0, 0], content='type@=loginreq/username@=/ct@=0/password@=/roomid@=321358/devid@=B609634DCCFC4DD48BF085BB35B7CF97/rt@=1453874133/vk@=1e1806220f06b5402cab6486e99e42da/ver@=20150929/', end=[0]}
如何使用 Python 的 struct.pack 来完成相同的功能?