Popen and python

popen, python

Solution

you should do:

import subprocess
subprocess.Popen(cmd, stderr=subprocess.STDOUT, stdout=subprocess.PIPE)
# etc.

Problem

Working on some code and I'm given the error when running it from the command prompt... ``` NameError: name 'Popen' is not defined ``` but I've imported both `import os` and `import sys`. Here's part of the code ``` exepath = os.path.join(EXE File location is here) exepath = '"' + os.path.normpath(exepath) + '"' cmd = [exepath, '-el', str(el), '-n', str(z)] print 'The python program is running this command:' print cmd process = Popen(cmd, stderr=STDOUT, stdout=PIPE) outputstring = process.communicate()[0] ``` Am I missing something elementary? I wouldn't doubt it. Thanks!

Original source