Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Laura Creighton Newsgroups: comp.lang.python Subject: Re: Weird list conversion Date: Sun, 13 Dec 2015 20:57:34 +0100 Lines: 20 Message-ID: References: <5926ced0-5b86-41f2-81e8-55cc6f71b78c@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Trace: news.uni-berlin.de ojo53H9nJqxNFfanhbH1UA+XX6Roqt/3MAOy5x12qcPg== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'cc:addr:python-list': 0.09; 'received:openend.se': 0.09; 'received:theraft.openend.se': 0.09; 'python': 0.10; 'cc:addr:lac': 0.16; 'cc:addr:openend.se': 0.16; 'editor,': 0.16; 'from:addr:lac': 0.16; 'from:addr:openend.se': 0.16; 'from:name:laura creighton': 0.16; 'hex': 0.16; 'message-id:@fido.openend.se': 0.16; 'received:fido': 0.16; 'received:fido.openend.se': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'byte': 0.18; 'all,': 0.20; '2015': 0.20; 'cc:addr:python.org': 0.20; 'cc:2**1': 0.22; 'ascii': 0.22; 'dec': 0.23; 'subject:list': 0.26; 'always,': 0.29; 'received:se': 0.29; 'cc:no real name:2**1': 0.29; 'print': 0.30; 'code': 0.30; 'help!': 0.30; 'file': 0.34; 'according': 0.36; 'subject:: ': 0.37; 'thanks': 0.37; 'charset:us-ascii': 0.37; 'why': 0.39; 'data': 0.39; 'does': 0.39; 'header:Message-Id:1': 0.61; 'email addr:gmail.com': 0.62; 'header:In-reply-to:1': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openend.se; s=default; t=1450036656; bh=QLxxx9w3RipxNvfw1uSmSm11WSegIdq/JTzTVcFbn3A=; h=To:cc:From:Subject:In-reply-to:References:Date:From; b=PNrNrfvvI8g9J84LDhEwa72pubtaIQ+35wdPh3uI0WF6l6b6QNq2wQY9DMi3IdK7Y Dm7B7iODR2aBe5/j2DaSK3yG2BOUbmEraDb3u1w6J4HOPnqe6woNuAZPUGzEfS87B6 vlD//AHZtjIhvwWhnAyL4Jt8bkJwF0TqhMT8ZkVc= In-reply-to: <5926ced0-5b86-41f2-81e8-55cc6f71b78c@googlegroups.com> Comments: In-reply-to high5storage@gmail.com message dated "Sun, 13 Dec 2015 11:45:19 -0800." Content-ID: <923.1450036654.1@fido> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.9 (theraft.openend.se [82.96.5.2]); Sun, 13 Dec 2015 20:57:36 +0100 (CET) X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com comp.lang.python:100388 In a message of Sun, 13 Dec 2015 11:45:19 -0800, high5storage@gmail.com wr= ites: >Hi all, > > f =3D open("stairs.bin", "rb") = > data =3D list(f.read(16)) > print data > >returns > >['=3D', '\x04', '\x00', '\x05', '\x00', '\x01', '\x00', '\x00', '\x00', '= \x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00'] > >The first byte of the file is 0x3D according to my hex editor, so why doe= s Python return '=3D' and not '\x3D'? > >As always, thanks for any help! 0x3d is the ascii code for '=3D'