Python subprocess arguments

前端 未结 3 1217
迷失自我
迷失自我 2021-01-01 23:09

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

At the moment I have th

3条回答
  •  误落风尘
    2021-01-01 23:40

    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.

    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.

提交回复
热议问题