[英]Python Popen Cannot Find the File Specified
I have the following code 我有以下代码
pathToFile = "R:\T2 Output\12345--01--Some File 1--ABCD.mp4"
process = subprocess.Popen(['ffprobe.exe', '-show_streams', '"'+pathToFile+'"'],
shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
I get the error: 我得到错误:
[Error 2] The system cannot find the file specified
What I have tried: 我试过的
Things of note: 注意事项:
I'm sure I'm missing something simple. 我确定我缺少一些简单的东西。 Can anyone point me in the right direction? 谁能指出我正确的方向? I've done quite a lot of searching on this site and others and trying suggestions. 我已经在该网站和其他网站上进行了大量搜索,并尝试提出建议。
\\
符号在python中算作转义字符,使用r
可以将其关闭:
pathToFile = r"R:\T2 Output\12345--01--Some File 1--ABCD.mp4"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.