Python version: '2.6.5 (r265:79063, Oct 1 2012, 22:07:21) \n[GCC 4.4.3]'
I have this:
>>> ss = subprocess.call("ls -z", shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) How do I get the error message now ?
This does not work:
>>> for i in subprocess.PIPE: ... print i ... Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: 'int' object is not iterable
shell=Trueand"ls -z"instead of["ls", "-z"]? It's not relevant to your problem, but generally, using the shell when you don't need to is a bad idea, as is passing command lines and hoping you got the escaping right so they get parsed into the list you had in mind.