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

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

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

          <bdo id='O0l6b'></bdo><ul id='O0l6b'></ul>

        如何使用 Python 运行外部可执行文件?

        How to run external executable using Python?(如何使用 Python 运行外部可执行文件?)

            <bdo id='Rb0Zy'></bdo><ul id='Rb0Zy'></ul>
              <legend id='Rb0Zy'><style id='Rb0Zy'><dir id='Rb0Zy'><q id='Rb0Zy'></q></dir></style></legend>

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

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

                • <i id='Rb0Zy'><tr id='Rb0Zy'><dt id='Rb0Zy'><q id='Rb0Zy'><span id='Rb0Zy'><b id='Rb0Zy'><form id='Rb0Zy'><ins id='Rb0Zy'></ins><ul id='Rb0Zy'></ul><sub id='Rb0Zy'></sub></form><legend id='Rb0Zy'></legend><bdo id='Rb0Zy'><pre id='Rb0Zy'><center id='Rb0Zy'></center></pre></bdo></b><th id='Rb0Zy'></th></span></q></dt></tr></i><div id='Rb0Zy'><tfoot id='Rb0Zy'></tfoot><dl id='Rb0Zy'><fieldset id='Rb0Zy'></fieldset></dl></div>
                  本文介绍了如何使用 Python 运行外部可执行文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我有一个外部可执行文件,我试图从 Python 脚本运行它.CMD 可执行文件运行但不生成输出.可能它在生成输出之前退出.关于如何延迟退出直到生成输出的任何建议?

                  I have an external executable file which I am trying to run from a Python script. CMD executable runs but without generating output. Probably it exit before output can be generated. Any suggestion about how to delay exit until outputs are generated?

                  import subprocess, sys
                  from subprocess import Popen, PIPE
                  exe_str = r"C:/Windows/System32/cmd C:/temp/calc.exe"
                  
                  parent = subprocess.Popen(exe_str, stderr=subprocess.PIPE)
                  

                  推荐答案

                  使用 subprocess.call,更多信息 这里:

                  import subprocess
                  subprocess.call(["C:\temp\calc.exe"])
                  

                  import os
                  os.system('"C:/Windows/System32/notepad.exe"')
                  

                  希望对你有帮助……

                  这篇关于如何使用 Python 运行外部可执行文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  groupby multiple coords along a single dimension in xarray(在xarray中按单个维度的多个坐标分组)
                  Group by and Sum in Pandas without losing columns(Pandas中的GROUP BY AND SUM不丢失列)
                  Group by + New Column + Grab value former row based on conditionals(GROUP BY+新列+基于条件的前一行抓取值)
                  Groupby and interpolate in Pandas(PANDA中的Groupby算法和插值算法)
                  Pandas - Group Rows based on a column and replace NaN with non-null values(PANAS-基于列对行进行分组,并将NaN替换为非空值)
                  Grouping pandas DataFrame by 10 minute intervals(按10分钟间隔对 pandas 数据帧进行分组)
                  <tfoot id='90S7C'></tfoot>
                    <bdo id='90S7C'></bdo><ul id='90S7C'></ul>

                      <legend id='90S7C'><style id='90S7C'><dir id='90S7C'><q id='90S7C'></q></dir></style></legend>
                      <i id='90S7C'><tr id='90S7C'><dt id='90S7C'><q id='90S7C'><span id='90S7C'><b id='90S7C'><form id='90S7C'><ins id='90S7C'></ins><ul id='90S7C'></ul><sub id='90S7C'></sub></form><legend id='90S7C'></legend><bdo id='90S7C'><pre id='90S7C'><center id='90S7C'></center></pre></bdo></b><th id='90S7C'></th></span></q></dt></tr></i><div id='90S7C'><tfoot id='90S7C'></tfoot><dl id='90S7C'><fieldset id='90S7C'></fieldset></dl></div>
                          <tbody id='90S7C'></tbody>
                      • <small id='90S7C'></small><noframes id='90S7C'>