Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何在 python 2.7 中str与unichrin连接Jupyter IPython?正如我尝试过的那样。
str
unichr
Jupyter IPython
string = 'blah blah' unicode_char = unichr(169) end_str = string + unicode_char end_str
会扔到u'blah blah\xa9'我想显示的地方blah blah©。
u'blah blah\xa9'
blah blah©
In Python 2 the strings are bytes and when you add a byte out of ASCII scope the string represents it as \x and a hexadecimal code. But if you call your unicode string from print it will show de unicode caracter, in your case a copyright symbol.
print end_str