如何克服python子流程模块中的语法错误?

时间:2019-05-31 04:56:35

标签: python subprocess

我正在尝试将视频.ts转换为我已导入子流程以转换视频的.mp4

subprocess.run(['ffmpeg', '-i', 'C:\Users\Gyana\Desktop\my project\blender-creating-game-animation-0-0.ts', 'C:\Users\Gyana\Desktop\my project\blender_creating_game_animation2460-0-0.mp4'])

def convert_video(video_input, video_output):
    cmds = ['ffmpeg', '-i', video_input, video_output]
    subprocess.Popen(cmds)

convert_video('C:\Users\Gyana\Desktop\my project\blender-creating-game-animation-0-0.ts','C:\Users\Gyana\Desktop\my project\lender.mp4')
  

python subpro.py文件“ subpro.py”,第7行cmds = ['ffmpeg','-i',   'C:\ Users \ Gyana \ Desktop \ my   project \ blender-creating-game-animation-0-0.ts',   'C:\ Users \ Gyana \ Desktop \ my   project \ blender_creating_game_animation2460-0-0.mp4']                              ^ SyntaxError:(unicode错误)“ unicodeescape”编解码器无法解码位置2-3中的字节:被截断   \ UXXXXXXXX逃脱

     

python subpro.py文件“ subpro.py”,第11行       convert_video('C:\ Users \ Gyana \ Desktop \ my project \ blender-creating-game-animation-0-0.ts','C:\ Users \ Gyana \ Desktop \ my   project \ lender.mp4')                    ^ SyntaxError:(unicode错误)“ unicodeescape”编解码器无法解码位置2-3中的字节:截断的\ UXXXXXXXX转义

0 个答案:

没有答案