Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #28205
| Path | csiph.com!usenet.pasdenom.info!news.albasani.net!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <d@davea.name> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.001 |
| X-Spam-Evidence | '*H*': 1.00; '*S*': 0.00; 'python,': 0.02; 'string.': 0.04; 'omit': 0.07; 'utf-8': 0.07; 'python': 0.09; 'excluding': 0.09; 'here?': 0.09; 'hiding': 0.09; 'replied': 0.09; 'unicode,': 0.09; '12:59': 0.16; 'backslashes': 0.16; 'integer.': 0.16; 'str()': 0.16; 'string': 0.17; 'wrote:': 0.17; 'fix': 0.17; 'skip:u 30': 0.17; 'string,': 0.17; 'trying': 0.21; 'earlier': 0.21; 'meant': 0.21; 'supposed': 0.21; '3.x': 0.22; 'assuming': 0.22; 'interpret': 0.22; 'to:2**1': 0.23; "i've": 0.23; 'idea': 0.24; 'header:In-Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; 'am,': 0.27; 'format,': 0.27; '>>>>': 0.29; 'str': 0.29; 'that.': 0.30; 'query': 0.30; 'function': 0.30; 'gets': 0.32; 'file': 0.32; 'message.': 0.33; 'to:addr:python-list': 0.33; 'list': 0.35; 'but': 0.36; 'should': 0.36; 'problems': 0.36; 'why': 0.37; 'subject:: ': 0.38; 'nothing': 0.38; 'sure': 0.38; 'to:addr:python.org': 0.39; 'received:192': 0.39; 'received:192.168': 0.40; 'end': 0.40; 'your': 0.60; 'real': 0.61; 'different': 0.63; 'header:Reply-To:1': 0.68; 'received:74.208': 0.71; 'reply-to:no real name:2**0': 0.72; 'received:74.208.4.194': 0.84; 'to:name:python': 0.84; 'mean.': 0.91; 'subject:know': 0.91 |
| Date | Sat, 01 Sep 2012 01:29:26 -0400 |
| From | Dave Angel <d@davea.name> |
| User-Agent | Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120714 Thunderbird/14.0 |
| MIME-Version | 1.0 |
| To | contro opinion <contropinion@gmail.com>, PYTHON <python-list@python.org> |
| Subject | Re: to know binary |
| References | <CA+YdQ_44L840OJ3H49wARV_sio67dmBtYzuyraHrRbdOA6urpQ@mail.gmail.com> <504191D4.8010300@davea.name> <CA+YdQ_4v+hNsSh5B0kU04mLzK+0OHO-cSs++fgRQyitDV68cGQ@mail.gmail.com> |
| In-Reply-To | <CA+YdQ_4v+hNsSh5B0kU04mLzK+0OHO-cSs++fgRQyitDV68cGQ@mail.gmail.com> |
| Content-Type | text/plain; charset=ISO-8859-1 |
| Content-Transfer-Encoding | 7bit |
| X-Provags-ID | V02:K0:aBPB24VC/6x18lsXKVRjEMrkEPKWBUjoHrWjv1uSXUr 15aV7t3AGnSEhsNwT51Sol8bg2Mf3TeCzCmZEVnv1bXW3IHDnf du8oUeHL1HcOtrSou++pFLJxD6TDL46neBRB8L666lHcfibmEp NYYpkbd1uoRV4u5ebFrhddvxja3X8AGvDl1fXsVNfK3M+HydHI azUcnjGLlvk71Gdfk2TieSFNOAvX9zL+FUoHzCzTdu1qbrD8vt UY6NBPEr1eEBDYQBPm3vG1jHrJ+RE+GcSuGbZ470Y/iSqKfABm d10nhV3liQb2FQls6tVP2iWP3yThJFCQ9iCAh6XxckTWRYdtA= = |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.15 |
| Precedence | list |
| Reply-To | d@davea.name |
| 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.25.1346477391.27098.python-list@python.org> (permalink) |
| Lines | 32 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1346477391 news.xs4all.nl 6949 [2001:888:2000:d::a6]:55317 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:28205 |
Show key headers only | View raw
On 09/01/2012 12:59 AM, contro opinion wrote:
1) you top-posted
2) you replied privately, excluding the list from your query
> the file is utf-8 format,
>>>> str='/0x31/0x32/0x33/0x34'
3) No idea what that value is supposed to mean. Perhaps you intended to
use backslashes here? And perhaps you meant to omit the zeroes?
>>>>
> why unicode(str,"utf-8").encode("utf-8") can not get 1234?
>
It gets a string, not an integer. And the string will be "1234" once
you fix the problems in the earlier line.
While you're at it, you should pick a better name for your string. str
already has a meaning in Python, and you're hiding that. No real harm
other than readability, but it'll be embarrassing when you actually need
to use the str() function and you end up trying to call your string.
Still not sure how to interpret your original message. You said nothing
about unicode, or conversions.
And I've been assuming you're using Python 2.x, but all this will be
different for 3.x
--
DaveA
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
Re: to know binary Dave Angel <d@davea.name> - 2012-09-01 01:29 -0400
csiph-web