擅长:python、mysql、java
<p>实际上wiki.python.org上有一篇关于这个问题的wiki文章<a href="https://wiki.python.org/moin/PrintFails" rel="nofollow">https://wiki.python.org/moin/PrintFails</a>,解释了为什么使用<code>charmap</code>编解码器可能会发生这种情况。</p>
<p><code>Setting the PYTHONIOENCODING environment variable as described above can be used to suppress the error messages. Setting to "utf-8" is not recommended as this produces an inaccurate, garbled representation of the output to the console. For best results, use your console's correct default codepage and a suitable error handler other than "strict".</code></p>