How would I write a regex that removes all comments that start with the # and stop at the end of the line -- but at the same time exclude the first two lines which say
sed -e '1,2p' -e '/^\s*#/d' infile
Then wrap this in a subprocess.Popen call.
However, this doesn't substitute a real parser! Why would this be of interest? Well, assume this Python script:
output = """ This is #1 of 100"""
Boom, any non-parsing solution instantly breaks your script.