win10+python3.5.0下解决OSError: raw write() returned invalid length 38

在pycharm下跑程序的时候出现错误:OSError: raw write() returned invalid length 38 (should have been between 0 and 19)。观察到38=19×2,应该是和系统有关的和字符显示相关的问题。解决办法:
pip install win-unicode-console,安装好该程序包后,在程序中加入
import win-unicode-console
win-unicode-console.enable()命令,即可解决问题~
对于为什么要安装该程序包,给出该程序包功能的描述:A Python package to enable Unicode input and display when running Python from Windows console.

越努力,越幸运~

你可能感兴趣的:(技术问题)