2
我剛從這裏開始,希望遵循所有規則。 我有一個字典,其鍵值對爲{..., 'CL': 'León', ...}
,將西班牙地區的縮寫(即'CL')與每個城市(即萊昂)的一個城市相匹配。我包括該行雙字節十六進制值
# _*_ coding: utf-8 _*_
在開始,所以我能夠使用utf字符,如tildes。問題是,當我打印出單個數值一切順利的話,輸出正確包括顎化:
print cities['CL']
然而,當我打印出整部字典爲:
print cities
我有雙字節十六進制字符,在這種情況下爲\xc3\xb3
。
這是爲什麼? 在此先感謝。
有趣的問題我的朋友,結賬https://stackoverflow.com/questions/8288551/how-do-i-display-non-english-characters-in-python –
的可能的複製[我如何顯示在Python中的非英文字符?](https://stackoverflow.com/questions/8288551/how-do-i-display-non-english-characters-in-python) – DyZ
而且這也是:https:// stackoverflow .com/questions/27814363/how-to-write-dict-into-file-with-characters-other-than-english-letters-in-python –