Strings show as brackets with a 'u'.
t at jollybox.de
Sun Jul 24 03:06:09 CEST 2011
On 24/07/11 02:52, Dan Stromberg wrote:
> It's probably a list containing a single unicode string.
> You can pull the first element from the list with n.
> To print a unicode string in 2.x without the u stuff:
> print u'174'.encode('ISO-8859-1')
>>> print u'174'
Encoding the string by hand is only useful if Python doesn't know the
terminal's encoding, but you do.
> On Sat, Jul 23, 2011 at 5:33 PM, goldtech <goldtech at worldpost.com
> <mailto:goldtech at worldpost.com>> wrote:
> >>> n
> Probably newbie question but not sure how suppress the brackets and
> the 'u' ? I assume pyhon is telling me it's a unicode string in the n
> 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
More information about the Python-list