python-3.x - 无法使用 Raspberry pi 和 Windows 10 终端在 Python 3.5 中打印完整块
问题描述
命令print(u'\u2588')
在 Python 在线编译器https://repl.it/languages/python3中运行良好,但在 Raspberry pi 中通过使用 Putty 的 Windows 10 终端运行良好。出现以下错误:
>>> print('\u2588')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
UnicodeEncodeError: 'ascii' codec can't encode character '\u2588' in position 0: ordinal not in range(128)
如果有人可以提供帮助,我会很高兴...
解决方案
使用 Python 3.7.3 全新安装 Raspbian Buster 解决了问题(以前我有 Python 3.5)。这可能是根本原因...
推荐阅读
- javascript - 在按钮单击时绘制多行 JavaScript - 不使用画布
- html - About xpath in table java
- clean-architecture - 清洁架构 - DTO 到业务模型的映射应该发生在哪里?
- network-programming - 无法从 HostOnlyNetwork 配置中的主机连接到 VM
- twitter-bootstrap - Bootstrap 4 Navbar 对齐徽标中心和左侧的切换图标
- ruby - 活动记录中的多对多不向一个方向返回值;在另一个重复
- mysql - 不能再用自制软件运行 mysql
- java - 是否可以自定义 Woodstox 错误消息
- mongodb - 当foreignField在嵌套数组中时的$lookup
- python - 如何使用 Pandas 按日期分组?