On 2018-08-20, Steven D'Aprano <steve+comp.lang.pyt...@pearwood.info> wrote:

> When I write bytes to stdout, why are they reversed?
>
> [steve@ando ~]$ python2.7 -c "print('\xfd\x84\x04\x08')" | hexdump
> 0000000 84fd 0804 000a
> 0000005

They aren't.  You're being fooled by the default output format of
hexdump.  By default, it displays data as 16-byte integers in
little-endian.  If you want to look at bytes, do this:

$ python2.7 -c "print('\xfd\x84\x04\x08')" | hexdump -C
00000000  fd 84 04 08 0a                                    |.....|
00000005


-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to