Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #10909
| Path | csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!feeder.news-service.com!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!194.109.133.85.MISMATCH!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <rosuav@gmail.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.009 |
| X-Spam-Evidence | '*H*': 0.98; '*S*': 0.00; 'string.': 0.04; '>>>>': 0.09; 'am,': 0.12; 'bitwise': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'wrote:': 0.16; 'string,': 0.18; 'subject:problem': 0.19; 'header:In-Reply-To:1': 0.22; 'though.': 0.23; 'aug': 0.24; 'message-id:@mail.gmail.com': 0.29; 'print': 0.29; 'operations': 0.30; 'subject:number': 0.30; 'probably': 0.33; 'to:addr:python-list': 0.33; 'fri,': 0.36; 'received:google.com': 0.38; 'received:209.85': 0.38; 'subject:: ': 0.39; 'subject:with': 0.39; 'to:addr:python.org': 0.39; "it's": 0.40 |
| DKIM-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=byNfFjGHocour3QLxJ6rzJ6Ymd8iIF3eKvjTB/0+G5Y=; b=Hq0TJjvtZZWPrlTlRC+8TMbKltk+3uw0oONrZ/SaDh81je4OSYbEDQfscpJjOjAMQ7 hcXQ5tZQ+ArSizwoesx10Et5bm6R3jRgivM9FDlmnnebeXnsIOCvGKTzv8gQ2u7GXMOe VUgZ13sx+9HrdI931+r4kWXKHvRqfIufdgh7A= |
| MIME-Version | 1.0 |
| In-Reply-To | <CAGGBd_owY1Jyb40nw29zwQDcFu+UrfCnWBLY-J9KGnzsbLvugg@mail.gmail.com> |
| References | <a59a0314-4fab-4a57-a648-daa2570f2f94@v7g2000vbk.googlegroups.com> <4E3AF2FA.7000207@ieee.org> <CAC6CgJ9QRRe+OU=RG+cK0NJuwdQw07qjR-Du98gi4O+NRicQ6A@mail.gmail.com> <CAGGBd_owY1Jyb40nw29zwQDcFu+UrfCnWBLY-J9KGnzsbLvugg@mail.gmail.com> |
| Date | Fri, 5 Aug 2011 16:32:03 +0100 |
| Subject | Re: problem with bcd and a number |
| From | Chris Angelico <rosuav@gmail.com> |
| To | python-list@python.org |
| Content-Type | text/plain; charset=ISO-8859-1 |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.12 |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <http://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 | <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.1928.1312558326.1164.python-list@python.org> (permalink) |
| Lines | 11 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1312558326 news.xs4all.nl 23881 [2001:888:2000:d::a6]:36377 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | x330-a1.tempe.blueboxinc.net comp.lang.python:10909 |
Show key headers only | View raw
On Fri, Aug 5, 2011 at 1:40 AM, Dan Stromberg <drsalists@gmail.com> wrote:
>>>> print int(hex(0x72).replace('0x', ''))
> 72
Or simpler: int(hex(0x72)[2:])
Although if you have it as a string, you need to ord() the string.
It's probably better to just do the bitwise operations though.
ChrisA
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
problem with bcd and a number nephish <nephish@gmail.com> - 2011-08-04 11:31 -0700 Re: problem with bcd and a number Dave Angel <davea@ieee.org> - 2011-08-04 15:28 -0400 Re: problem with bcd and a number Christoph Hansen <ch@radamanthys.de> - 2011-08-04 21:31 +0200 Re: problem with bcd and a number Chris Angelico <rosuav@gmail.com> - 2011-08-05 16:32 +0100 Re: problem with bcd and a number Peter Otten <__peter__@web.de> - 2011-08-05 17:52 +0200
csiph-web