Manipulating text files: Line deletion if keyword is found
<p>So I'm attempting to clean up a text file that I have (it is actually a region file which can be loaded into the astronomy fits viewer DS9). I would like to remove/delete the entirety of any line/(s) which contain the keyword "red" in them, for an example:</p>

<pre><code>image;circle(2384.21957861,231.579450647,10.3410929712) # color = red text = {24}
</code></pre>

<p>Would anyone know how this could be accomplished within python?</p>