我知道我做错了什么。Python subprocess.check_call问题
在壳我键入:
cuebreakpoints cuefile.cue | shnsplit -o flac flacfile.flac
这将随后根据cuefile分裂后手文件。由于我正在编写一个小型的帮助工具(使用Python)来转换flac文件,所以我显然希望将这一位合并到我的代码中。
因此,在一个Python化的方式,我写道:
for root, dirs, files in os.walk(args):
...
cmd = ('cuebreakpoints', cue, '|', 'shnsplit', '-o', 'flac', flacs[0])
subprocess.check_call(cmd, cwd=None)
....
'提示' 是cuefile和 'FLACS [0]' 是后手文件。但我得到一个:
subprocess.CalledProcessError: Command '('cuebreakpoints', '41_30sec.cue', '|', 'shnsplit', '-o', 'flac', '41_30sec.flac')' returned non-zero exit status 1
由于PIPE有问题吗?
谢谢,我会用它。 –