<legend id='w9N8d'><style id='w9N8d'><dir id='w9N8d'><q id='w9N8d'></q></dir></style></legend>

        <i id='w9N8d'><tr id='w9N8d'><dt id='w9N8d'><q id='w9N8d'><span id='w9N8d'><b id='w9N8d'><form id='w9N8d'><ins id='w9N8d'></ins><ul id='w9N8d'></ul><sub id='w9N8d'></sub></form><legend id='w9N8d'></legend><bdo id='w9N8d'><pre id='w9N8d'><center id='w9N8d'></center></pre></bdo></b><th id='w9N8d'></th></span></q></dt></tr></i><div id='w9N8d'><tfoot id='w9N8d'></tfoot><dl id='w9N8d'><fieldset id='w9N8d'></fieldset></dl></div>

        • <bdo id='w9N8d'></bdo><ul id='w9N8d'></ul>
        <tfoot id='w9N8d'></tfoot>

        <small id='w9N8d'></small><noframes id='w9N8d'>

        抑制 subprocess.Popen 的输出

        时间:2023-07-22

        <small id='3HTfp'></small><noframes id='3HTfp'>

            <bdo id='3HTfp'></bdo><ul id='3HTfp'></ul>

          • <i id='3HTfp'><tr id='3HTfp'><dt id='3HTfp'><q id='3HTfp'><span id='3HTfp'><b id='3HTfp'><form id='3HTfp'><ins id='3HTfp'></ins><ul id='3HTfp'></ul><sub id='3HTfp'></sub></form><legend id='3HTfp'></legend><bdo id='3HTfp'><pre id='3HTfp'><center id='3HTfp'></center></pre></bdo></b><th id='3HTfp'></th></span></q></dt></tr></i><div id='3HTfp'><tfoot id='3HTfp'></tfoot><dl id='3HTfp'><fieldset id='3HTfp'></fieldset></dl></div>

                <legend id='3HTfp'><style id='3HTfp'><dir id='3HTfp'><q id='3HTfp'></q></dir></style></legend>
                  <tbody id='3HTfp'></tbody>
                <tfoot id='3HTfp'></tfoot>

                • 本文介绍了抑制 subprocess.Popen 的输出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  如何停止 subprocess.Popen 的输出?如果打印量很大,打印有时会很慢.

                  How do you stop the output from subprocess.Popen from being output? Printing can sometimes be slow if there is a great deal of it.

                  推荐答案

                  如果你想彻底扔掉:

                  import subprocess
                  import os
                  with open(os.devnull, 'w') as fp:
                      cmd = subprocess.Popen(("[command]",), stdout=fp)
                  

                  如果您使用的是 Python 2.5,则需要 from __future__ import with_statement,或者干脆不要使用 with.

                  If you are using Python 2.5, you will need from __future__ import with_statement, or just don't use with.

                  这篇关于抑制 subprocess.Popen 的输出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:WindowsError [错误 5] 访问被拒绝 下一篇:subprocess.wait() 不等待 Popen 进程完成(使用线程时)?

                  相关文章

                    <tfoot id='sELMx'></tfoot>
                  1. <i id='sELMx'><tr id='sELMx'><dt id='sELMx'><q id='sELMx'><span id='sELMx'><b id='sELMx'><form id='sELMx'><ins id='sELMx'></ins><ul id='sELMx'></ul><sub id='sELMx'></sub></form><legend id='sELMx'></legend><bdo id='sELMx'><pre id='sELMx'><center id='sELMx'></center></pre></bdo></b><th id='sELMx'></th></span></q></dt></tr></i><div id='sELMx'><tfoot id='sELMx'></tfoot><dl id='sELMx'><fieldset id='sELMx'></fieldset></dl></div>
                        <bdo id='sELMx'></bdo><ul id='sELMx'></ul>

                    1. <small id='sELMx'></small><noframes id='sELMx'>

                      <legend id='sELMx'><style id='sELMx'><dir id='sELMx'><q id='sELMx'></q></dir></style></legend>