我在Python中重写了以下Perl code:
my $data = Data::AMF::Packet->new->deserialize($packet);
$data->messages->[0]->{value}->[1] = $data->messages->[1]->{value}->[1] = $mid;
$data = $data->serialize;
我想知道如何用Python编写这个?我是PyAMF的新手,我用Google搜索的例子也无济于事。
非常感谢!
答案 0 :(得分:1)
有些事情:
from pyamf import remoting
packet = remoting.decode(bytes)
packet['/1'][1] = packet['/2'][1]
stream = remoting.encode(packet)
bytes = stream.getvalue()