Running cmd in python

后端 未结 4 1970
南方客
南方客 2020-12-28 22:12

Atm I have this as my code, the first line seems to work well but the 2nd gives errrors.

os.chdir(\'C://Users/Alex/Dropbox/code stuff/test\')
subprocess.call(         


        
4条回答
  •  清酒与你
    2020-12-28 22:51

    For the later generations looking for the answer, this worked. (You have to separate the command by the spaces.)

    import os
    import subprocess
    os.chdir('C://Users/Alex/')
    subprocess.call(['ffmpeg', '-i', 'picture%d0.png', 'output.avi'])
    subprocess.call(['ffmpeg', '-i', 'output.avi', '-t', '5', 'out.gif'])
    

提交回复
热议问题