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

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

        <tfoot id='H9xve'></tfoot>
          <bdo id='H9xve'></bdo><ul id='H9xve'></ul>

        如何使用子进程popen Python

        时间:2023-07-22
      3. <legend id='Go9Ix'><style id='Go9Ix'><dir id='Go9Ix'><q id='Go9Ix'></q></dir></style></legend>

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

          <tfoot id='Go9Ix'></tfoot>
            <tbody id='Go9Ix'></tbody>

              <bdo id='Go9Ix'></bdo><ul id='Go9Ix'></ul>
                1. <small id='Go9Ix'></small><noframes id='Go9Ix'>

                  本文介绍了如何使用子进程popen Python的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  由于 os.popensubprocess.popen 取代,我想知道如何转换

                  Since os.popen is being replaced by subprocess.popen, I was wondering how would I convert

                  os.popen('swfdump /tmp/filename.swf/ -d')
                  

                  subprocess.popen()

                  我试过了:

                  subprocess.Popen("swfdump /tmp/filename.swf -d")
                  subprocess.Popen("swfdump %s -d" % (filename))  # NOTE: filename is a variable
                                                                  # containing /tmp/filename.swf
                  

                  但我想我没有正确地写出来.任何帮助,将不胜感激.谢谢

                  But I guess I'm not properly writing this out. Any help would be appreciated. Thanks

                  推荐答案

                  subprocess.Popen 采用参数列表:

                  from subprocess import Popen, PIPE
                  
                  process = Popen(['swfdump', '/tmp/filename.swf', '-d'], stdout=PIPE, stderr=PIPE)
                  stdout, stderr = process.communicate()
                  

                  甚至还有一个 部分文档 致力于帮助用户从 os.popen 迁移到 subprocess.

                  There's even a section of the documentation devoted to helping users migrate from os.popen to subprocess.

                  这篇关于如何使用子进程popen Python的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:Python:并行执行 cat 子进程 下一篇:非阻塞 subprocess.call

                  相关文章

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

                      • <bdo id='dYx2M'></bdo><ul id='dYx2M'></ul>

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