我正在尝试使用子进程对2个文件进行排序后将它们结合在一起。但是我收到以下错误。尝试转义'/',也没有帮助。
cmd = "join --nocheck-order -t/: <(sort file1) <(sort file2)"
proc = subprocess.Popen([cmd], stdout=subprocess.PIPE, stderr=subprocess.PIPE, shellresult = proc.communicate()
print result
('', '/bin/sh: 1: Syntax error: "(" unexpected\n')
您在使用<(sort file)
语法时遇到问题。尝试在Popen()中使用shell = True