On Mon, Jul 25, 2011 at 10:48 AM, MikeKJ <mike.jo...@paston.co.uk> wrote: > > #from a json stream I have > > url = "http://xxxx.xxxx.org/api/vvvv/%s" % id > site = urllib2.urlopen(url) > stuff = simplejson.load(site) > > #within stuff is a list? of images (large, medium and small), just examine > large > > large = map(lambda i: i['paths']['large'], stuff['vvvv']['images']) > > #this returns > [u'/system/imgs/113/zoom/T44.jpg?1294157316', > u'/system/imgs/114/zoom/2285731_9[1].jpg?1294157421', > u'/system/imgs/115/zoom/2285731_17[1].jpg?1294157421', > u'/system/imgs/116/zoom/2285731_5[1].jpg?1294157422'] > > #I want to strip the u from each iteration but maintain the list as is > ['/system/imgs/113/zoom/T44.jpg?1294157316', > '/system/imgs/114/zoom/2285731_9[1].jpg?1294157421', > '/system/imgs/115/zoom/2285731_17[1].jpg?1294157421', > '/system/imgs/116/zoom/2285731_5[1].jpg?1294157422'] > > cant just strip the u as it just may turn up in the string any ideas? > >
'The u' is not part of the string, it is how one denotes a unicode string in python. 'a string' u'a unicode string' You do not want to strip 'the u'. If you want more info, read the python documentation on unicode strings[1]. Cheers Tom [1] http://docs.python.org/howto/unicode.html -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.