我是 python 的新手。我正在尝试打印重音字符,如下所示:
# -*- coding: utf-8 -*-
print 'éàÇÃãéèï'
但是当我执行这段代码时,我得到:
>> ├®├á├ç├â├ú├®├¿├»
我正在使用 64 位 Windows 7 和 Python 2.7.5,我在 file.py
中有代码并用
python file.py
最佳答案
正如 Wooble 所说,如果你改变
print 'éàÇÃãéèï'
到
print u'éàÇÃãéèï'
它应该可以工作。
这是 python 中 unicode 的一个很好的介绍(适用于 2.x 和 3): The updated guide to unicode
关于python - 在 Python 2.7 中打印重音字符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18445655/