擅长:python、mysql、java
<p>问题是你使用的模块做了一些你不希望模块做的事情。在</p>
<pre><code>print (
'WARNING: problems with charset recognition',
repr(temp))
</code></pre>
<p>好吧,不能就这样残废。但是他们的好所以线程如何达到同样的效果。在</p>
<p><a href="https://stackoverflow.com/questions/2828953/silence-the-stdout-of-a-function-in-python-without-trashing-sys-stdout-and-resto">Silence the stdout of a function in Python without trashing sys.stdout and restoring each function call</a></p>
<p><a href="https://stackoverflow.com/questions/8391411/suppress-calls-to-print-python">Suppress calls to print (python)</a></p>
<p>所以把两者结合起来</p>
^{pr2}$
<p>而且效果很好</p>
<p><a href="https://i.stack.imgur.com/3uPGG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3uPGG.png" alt="No Print"/></a></p>