formatted string like---> u'720 S'

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Bell, Kevin

    #1

    formatted string like---> u'720 S'

    I'm building a dictionary from values a database and upon print the
    dictionary I see key value pairs like this:

    u'Briarcliff' : [u'2500 E'],
    u'Shumway' : [ u'2600 E']

    do I need to slice off the "u", or anything? I know it has something to
    do with unicode but I don't know how to treat it.
  • Steven D'Aprano

    #2
    Re: formatted string like---> u'720 S'

    On Thu, 23 Feb 2006 08:00:16 -0700, Bell, Kevin wrote:
    [color=blue]
    > I'm building a dictionary from values a database and upon print the
    > dictionary I see key value pairs like this:
    >
    > u'Briarcliff' : [u'2500 E'],
    > u'Shumway' : [ u'2600 E']
    >
    > do I need to slice off the "u", or anything? I know it has something to
    > do with unicode but I don't know how to treat it.[/color]

    No. The u is part of the display of the string, just like the quote marks.

    Ordinary strings are printed with ' ' delimiters.
    Unicode strings are printed with u' ' delimiters.



    --
    Steven.

    Comment

    Working...