[Biopython] Entrez.read return value is typed as a string??

Peter biopython at maubp.freeserve.co.uk
Thu Oct 29 15:37:21 UTC 2009


On Thu, Oct 29, 2009 at 2:59 PM, Ben O'Loghlin <bassbabyface at yahoo.com> wrote:
> Thanks Michiel.
>
> What is the function of the 'u' in the string discussed below?
> That's the bit that's got me confused.
>
> Best regards,
> Ben
>
> p.s. assistance on this list is fast and useful. Nice!

Again, its a bit of Python basics rather than anything Biopython
specific. The u is for unicode, thus "fred" gives a normal string
while u"fred" gives a unicode string. Unless you are messing
about with odd foreign characters (e.g. letters with accents) you
won't have to worry about this. Python 3 gets rid of the dichotomy
by using unicode for all strings.

Peter



More information about the Biopython mailing list