如何运行以下行?
subprocess.Popen(('cut', '-d', '" "', '-f', '1'), stdin=out_2.stdout, stdout=subprocess.PIPE)
它返回此错误:
cut: the delimiter must be a single character
答案 0 :(得分:2)
不要双引号:
subprocess.Popen(('cut', '-d', ' ', '-f', '1'), stdin=out_2.stdout, stdout=subprocess.PIPE)
^^^
就足够了!