Sending piped commands via python3 subprocess
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am trying to execute the following subprocess command via python3.4 cd /home/mailer-domains/domain | rndc loadkeys domain I have tried numerous methods using .call and .Popen but it either doesn't like my pipe or it doesn't like my switch >>> subprocess.call(['cd /home/mailer-domains/'+domain, '|', 'rndc', 'loadkeys', domain]) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/local/lib/python3.4/subprocess.py", line 537, in call with Popen(*popenargs, **kwargs) as p: File "/usr/local/lib/python3.4/subprocess