SyntaxFix
Write A Post
Hire A Developer
Questions
You have to use Popen like this:
cmd = ['sudo', 'apache2ctl', 'restart'] proc = subprocess.Popen(cmd, shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
It expects a list.