I want to write a python script to format files using Seds.
sub = subprocess.call(['sed', 's/=/ = /g', infilename], stdout = outfile)
sub = subprocess.call(['sed', 's/= = /==/g', infilename], stdout = outfile)
But this would write the entire changed infile twice to outfile (outfile contains two infiles in which each has one sed change). Is there a way to execute the two (and more) sed commands on the infile and write only once to the outfile which contains all the sed changes.