os.popen encoding!

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Thu Feb 19 03:54:29 EST 2009


En Wed, 18 Feb 2009 22:38:45 -0200, SMALLp <pofuk at email.t-com.hr> escribió:

> Thanks for help!
>
> My problem was actualy:
>>>> a = ["velja\xe8a 2009"]
>>>> print a    #will print
> ["velja\xe8a 2009"]
>>>> Print a[0]    #will print
> veljaèa 2009

And why is that a problem?

Almost the only reason to print a list is when debugging a program. To
print a list, Python uses repr() on each of its elements. Otherwise, [5,
"5", u'5'] would be indistinguishable from [5, 5, 5], and you usually want
to know exactly *what* the list contains.

Perhaps if you tell us what do you want to do exactly someone can offer
more advice.

-- 
Gabriel Genellina




More information about the Python-list mailing list