Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > de.comp.lang.python > #5378
| From | Julian Gethmann <mail.python.org@gethmann.org> |
|---|---|
| Newsgroups | de.comp.lang.python |
| Subject | Re: [Python-de] binary struct in Python |
| Date | 2018-12-21 09:50 +0100 |
| Message-ID | <mailman.46.1545382210.31622.python-de@python.org> (permalink) |
| References | <2456b27e-f194-d6d4-173c-ddc36d255b91@gethmann.org> <0a5b55a2-6deb-7322-41ba-312a39307cf0@chrisarndt.de> <6a70af2d-c2b7-007a-a870-781603d30da1@gethmann.org> |
Vielen Dank.
Dann habe ich wohl das mit dem Alignment nicht beachtet.
Gruß,
Julian
On 20/12/2018 17.01, Christopher Arndt wrote:
> Am 20.12.18 um 15:45 schrieb Julian Gethmann:
>> Eigentlich könnte man sie mit "cffffefc" lesen,
> Wenn der Formatstring kein Präfix hat, wird native Byteorder und
> Alignment angenommen.
>
> https://docs.python.org/3/library/struct.html#byte-order-size-and-alignment
>
> Du hast aber kein Alignment, also musst ein Präfix benutzen, also z.B.
> bei Big-Endian Byteorder:
>
> >>> struct.unpack('>cffffefc', data)
> (b'B', 4.3712104296148344e-41, 2.822691548628052e-40,
> 1.0399035903754467e-40, 5.658303069097179e-41,
> 0.00034618377685546875, 0.0, b'\r')
>
>
> Gruß, Chris
> _______________________________________________
> python-de maillist - python-de@python.org
> https://mail.python.org/mailman/listinfo/python-de
>
Back to de.comp.lang.python | Previous | Next | Find similar
Re: [Python-de] binary struct in Python Julian Gethmann <mail.python.org@gethmann.org> - 2018-12-21 09:50 +0100
csiph-web