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

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

    1. Python 子进程参数

      Python subprocess arguments(Python 子进程参数)
    2. <small id='KW80a'></small><noframes id='KW80a'>

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

          <tbody id='KW80a'></tbody>
          <tfoot id='KW80a'></tfoot>
        • <legend id='KW80a'><style id='KW80a'><dir id='KW80a'><q id='KW80a'></q></dir></style></legend>
            <bdo id='KW80a'></bdo><ul id='KW80a'></ul>
              1. 本文介绍了Python 子进程参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                例如我正在使用 ffplay 并想运行这个命令 -bufsize[:stream_specifier] integer (output,audio,video)

                For example I am using ffplay and want to run this command -bufsize[:stream_specifier] integer (output,audio,video)

                目前我有这个:

                subprocess.call(["ffplay", "-vn", "-nodisp","-bufsize 4096", "%s" % url])
                

                但这说明它是无效的.

                推荐答案

                正如 JBernardo 在评论中提到的,将 "-bufsize 4096" 参数一分为二,"-bufsize",4096".当 subprocess.callshell=False (默认)一起使用时,每个参数都需要分开.您还可以指定 shell=True 并将整个命令作为单个字符串提供,但由于潜在的安全漏洞,不建议这样做.

                As JBernardo mentioned in a comment, separate the "-bufsize 4096" argument into two, "-bufsize", "4096". Each argument needs to be separated when subprocess.call is used with shell=False (the default). You can also specify shell=True and give the whole command as a single string, but this is not recommended due to potential security vulnerabilities.

                您不需要在有 "%s" % url 的地方使用字符串格式.如果url是字符串,直接传递,否则调用str(url)得到字符串表示.

                You should not need to use string formatting where you have "%s" % url. If url is a string, pass it directly, otherwise call str(url) to get a string representation.

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

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

                相关文档推荐

                Pythonic and efficient way of finding adjacent cells in grid(在网格中查找相邻单元格的 Pythonic 和有效方法)
                map a hexagonal grid in matplotlib(在 matplotlib 中映射六边形网格)
                Execute arbitrary python code remotely - can it be done?(远程执行任意 python 代码 - 可以吗?)
                Python - Plotting colored grid based on values(Python - 根据值绘制彩色网格)
                Is there a GUI design app for the Tkinter / grid geometry?(是否有 Tkinter/网格几何图形的 GUI 设计应用程序?)
                tkinter Canvas Scrollbar with Grid?(带有网格的 tkinter 画布滚动条?)

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

                      <legend id='BSjX0'><style id='BSjX0'><dir id='BSjX0'><q id='BSjX0'></q></dir></style></legend>
                        1. <tfoot id='BSjX0'></tfoot>

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