Thread python nach perl -> pack / unpack
(10 answers)
Opened by egal123 at 2015-12-09 19:41
hi @all,
kann mir jemand sagen wie man folgenden python-code in perl mit pack/unpack umsetzt, alle meine versuche sind leider gescheitert ... Code (python): (dl
)
1 2 bits = pack('uint:5, uint:1, uint:10, uint:8', a, b, c, d) byte1, byte2, byte3 = bits.unpack('bytes:1,bytes:1,bytes:1') folgendes funktioniert bei mir leider nicht ;( Code (perl): (dl
)
1 2 my $bits = pack('I>5I>1I>10I>8',$a, $b, $c, $d); my @bytes = unpack('B1 B1 B1 B1', $bits); modedit Editiert von pq: code-tags hinzugefĆ¼gt Last edited: 2015-12-09 19:47:00 +0100 (CET) |