Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #100388
| Path | csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail |
|---|---|
| From | Laura Creighton <lac@openend.se> |
| Newsgroups | comp.lang.python |
| Subject | Re: Weird list conversion |
| Date | Sun, 13 Dec 2015 20:57:34 +0100 |
| Lines | 20 |
| Message-ID | <mailman.216.1450036662.12405.python-list@python.org> (permalink) |
| 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 | <lac@openend.se> |
| 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 <python-list.python.org> |
| List-Unsubscribe | <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list/> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Xref | csiph.com comp.lang.python:100388 |
Show key headers only | View raw
In a message of Sun, 13 Dec 2015 11:45:19 -0800, high5storage@gmail.com writes:
>Hi all,
>
> f = open("stairs.bin", "rb")
> data = list(f.read(16))
> print data
>
>returns
>
>['=', '\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 does Python return '=' and not '\x3D'?
>
>As always, thanks for any help!
0x3d is the ascii code for '='
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Weird list conversion high5storage@gmail.com - 2015-12-13 11:45 -0800
Re: Weird list conversion Laura Creighton <lac@openend.se> - 2015-12-13 20:57 +0100
Re: Weird list conversion KP <kai.peters@gmail.com> - 2015-12-13 12:05 -0800
Re: Weird list conversion Erik <python@lucidity.plus.com> - 2015-12-13 20:28 +0000
Re: Weird list conversion Ian Kelly <ian.g.kelly@gmail.com> - 2015-12-13 13:28 -0700
Re: Weird list conversion Erik <python@lucidity.plus.com> - 2015-12-13 20:31 +0000
Re: Weird list conversion Larry Hudson <orgnut@yahoo.com> - 2015-12-13 12:42 -0800
Re: Weird list conversion Chris Angelico <rosuav@gmail.com> - 2015-12-14 08:09 +1100
Re: Weird list conversion Ian Kelly <ian.g.kelly@gmail.com> - 2015-12-13 12:59 -0700
csiph-web