Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #10181

Re: Strings show as brackets with a 'u'.

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!feeder.news-service.com!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!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.021
X-Spam-Evidence '*H*': 0.96; '*S*': 0.00; 'suppress': 0.07; 'string;': 0.09; 'subject:show': 0.09; 'am,': 0.13; 'wrote:': 0.15; 'assigns': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'rantingrick': 0.16; "subject:'.": 0.16; '\xa0in': 0.16; '>>>': 0.16; 'received:209.85.210.174': 0.19; 'received:mail-iy0-f174.google.com': 0.19; 'ignore': 0.21; 'header :In-Reply-To:1': 0.22; 'there.': 0.25; 'tried': 0.27; 'seeing': 0.28; 'message-id:@mail.gmail.com': 0.28; 'script': 0.29; '24,': 0.29; 'idle': 0.29; 'shell': 0.29; 'unicode': 0.29; 'sun,': 0.30; 'print': 0.32; 'chris': 0.32; 'value.': 0.32; "i've": 0.33; 'to:addr:python-list': 0.34; 'instead': 0.34; 'there': 0.34; 'appreciated': 0.34; 'things': 0.34; 'safely': 0.35; 'try:': 0.35; 'some': 0.37; 'using': 0.37; 'received:google.com': 0.38; 'received:209.85': 0.38; 'subject:: ': 0.38; 'returning': 0.38; 'two': 0.38; 'should': 0.39; 'data': 0.39; 'list,': 0.39; 'subject:with': 0.39; "there's": 0.39; 'to:addr:python.org': 0.39; 'received:209': 0.40; 'your': 0.60; 'show': 0.67; 'content.': 0.71; '10:33': 0.84; '2.7.': 0.84; "\xa0i'm": 0.84
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:content-transfer-encoding; bh=NE65QUdF9Kr462eSQa2OZCAjFqHxtft2i5ncBZzIbcg=; b=G42YfwOYmeiXbfxEn5XWCyUX4+tYpa7pHzag6jBdnfCOKjOWPFB/NqmToNVRitOTqN 2ZnbcDjid/f9441J13rEepnWwNMNKi6uUb9/sRt8EXwOUPR1j2Yr7J7IFukSUSr/mo1a Ytk8c3V20Qr4OhEdzWxxXIocAr5XANWqBEHZA=
MIME-Version 1.0
In-Reply-To <d3c602cf-8a80-4035-9478-22d9b00022c2@r5g2000prf.googlegroups.com>
References <d3c602cf-8a80-4035-9478-22d9b00022c2@r5g2000prf.googlegroups.com>
Date Sun, 24 Jul 2011 10:52:47 +1000
Subject Re: Strings show as brackets with a 'u'.
From Chris Angelico <rosuav@gmail.com>
To python-list@python.org
Content-Type text/plain; charset=ISO-8859-1
Content-Transfer-Encoding quoted-printable
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.1407.1311468776.1164.python-list@python.org> (permalink)
Lines 18
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1311468776 news.xs4all.nl 23941 [2001:888:2000:d::a6]:40463
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:10181

Show key headers only | View raw


On Sun, Jul 24, 2011 at 10:33 AM, goldtech <goldtech@worldpost.com> wrote:
>
>  I'm using using Idle on winXP, activestate 2.7. Is there a way to
> suppress this and just show 174  in the shell ?
> A script reading data and assigns 174 to n via some regex. Links on
> this appreciated - I've tried to understand unicode before, will keep
> trying...thanks.

There's two things there. Firstly, your regex is returning a list, not
a string; and secondly, you are seeing repr(n) instead of just its
content. Try:
>>> print(n[0])

This should print just the value.

(Pro tip: rantingrick is a troll. You can safely ignore him.)

Chris Angelico

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Strings show as brackets with a 'u'. goldtech <goldtech@worldpost.com> - 2011-07-23 17:33 -0700
  Re: Strings show as brackets with a 'u'. rantingrick <rantingrick@gmail.com> - 2011-07-23 17:48 -0700
  Re: Strings show as brackets with a 'u'. Chris Angelico <rosuav@gmail.com> - 2011-07-24 10:52 +1000
    Re: Strings show as brackets with a 'u'. Ulrich Eckhardt <ulrich.eckhardt@dominolaser.com> - 2011-07-25 10:00 +0200
      Re: Strings show as brackets with a 'u'. rantingrick <rantingrick@gmail.com> - 2011-07-26 17:33 -0700
  Re: Strings show as brackets with a 'u'. Thomas Jollans <t@jollybox.de> - 2011-07-24 03:06 +0200
    Re: Strings show as brackets with a 'u'. goldtech <goldtech@worldpost.com> - 2011-07-26 18:18 -0700
      Re: Strings show as brackets with a 'u'. Terry Reedy <tjreedy@udel.edu> - 2011-07-26 23:04 -0400
        Re: Strings show as brackets with a 'u'. goldtech <goldtech@worldpost.com> - 2011-07-27 16:37 -0700
      Re: Strings show as brackets with a 'u'. Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-07-27 14:20 +1000

csiph-web