如何在Python代码中实现中文单词的打印?
- 内容介绍
- 文章标签
- 相关推荐
本文共计457个文字,预计阅读时间需要2分钟。
这是我的代码:`print('哈哈'.decode('gb2312').encode('utf-8'))`。它打印出:`SyntaxError: Non-ASCII character '\xe5' in file D:\zjm_code\A.py on line 2, but no encoding declared; see http://www.python.org/peps/pep-0263. for details`。
本文共计457个文字,预计阅读时间需要2分钟。
这是我的代码:`print('哈哈'.decode('gb2312').encode('utf-8'))`。它打印出:`SyntaxError: Non-ASCII character '\xe5' in file D:\zjm_code\A.py on line 2, but no encoding declared; see http://www.python.org/peps/pep-0263. for details`。

