subprocess

作者: 梁新彦 | 来源:发表于2017-12-08 12:12 被阅读2次
  • call:可以运行系统命令。如:
 retcode = call(["ls", "-l"])

Run command with arguments. Wait for command to complete or timeout, then return the return code attribute. The arguments are the same as for the Popen constructor.

from subprocess import call

src = train_or_test + '/' + classname + '/' + filename
 dest = train_or_test + '/' + classname + '/' +  filename_no_ext + '-%04d.jpg'
call(["ffmpeg", "-i", src, dest])

相关文章

网友评论

    本文标题:subprocess

    本文链接:https://www.haomeiwen.com/subject/cvkeixtx.html