import sys,re,os
from subprocess import Popen, PIPE, call
newCmd = 'diff -qr -b -B '+sys.argv[1]+' '+sys.argv[2]+' --exclude-from='+sys.argv[3]+' | grep pattern1\|pattrern2 > outputFile'
ouT,erR = Popen(newCmd, shell=True).communicate()
print ouT,erR
ouT and erR are printing None, None
and the outputFile is a blank file.
When i execute the same 'newCmd' in normal shell, its executing fine
Basically, the intention here is to redirect the output of shell command into a file inside python ..Tried different approaches (using call), nothing worked out for me