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


Groups > comp.lang.python > #10368

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

From Terry Reedy <tjreedy@udel.edu>
Subject Re: Strings show as brackets with a 'u'.
Date 2011-07-26 23:04 -0400
References <d3c602cf-8a80-4035-9478-22d9b00022c2@r5g2000prf.googlegroups.com> <CAGGBd_qOfUV=DbHT6CW8EWJohxCS5e=-Kx07m_YdDj==G0zUkQ@mail.gmail.com> <mailman.1408.1311469574.1164.python-list@python.org> <9843961d-cc18-45f8-b33a-e2ca716df283@d8g2000prf.googlegroups.com>
Newsgroups comp.lang.python
Message-ID <mailman.1525.1311735911.1164.python-list@python.org> (permalink)

Show all headers | View raw


On 7/26/2011 9:18 PM, goldtech wrote:
> Thank you. So what is happening? Is it that I'm in an environment that
> is not unicode and python is telling me the string (ie. n[0]) is
> unicode?

Yes, n is a list and n[0] is a unicode string and you are using some 
2.x, which is ascii/byte string based. Python 3 is unicode based.

If you do not *need* to use 2.x and are just learning Python, I 
personally recommend starting with Python 3. Others agree with me, still 
other do not. I would add 'especially if you want to use unicode'.

Rick gave you some good advice, perhaps worth re-reading. What you need 
are investigative skills, and not just bits of data.

-- 
Terry Jan Reedy

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