Please observe the following behavior:
a = u"foo" b = u"b\xe1r" # \xe1 is an 'a' with an accent s = [a, b] print a, b print s for x in s: print x,
Firstly, is there one? If not, is there a nice way to force something like
print '%s' % obj
obj.__unicode__
obj.__str__
I am using Python 2.6.5. My code requires the use of the "more than or equal to" sign. Here it goes:
>>> s = u'\u2265' >>> print s >>> ? >>> print "{0}".format(s) Traceback ...
In python 2.71 on Windows XP I need to use FTP. My code is :
try: ftp = FTP(trec.address) ftp.login(trec.login, trec.passw) s = ...
I am trying do string formatting with a unicode variable. For example:
>>> x = u"Some text—with an emdash." >>> x u'Some text\u2014with an emdash.' >>> print(x) Some text—with an emdash. >>> s = "{}".format(x) Traceback (most recent ...