Python one-liner to replace one word with another word in text file
<p>I'm trying to use Python (through a Linux terminal) to replace the word 'example' in following line of a text file <code>text_file.txt</code>:</p>

<pre><code>abcdefgh example uvwxyz
</code></pre>

<p>What I want is:</p>

<pre><code>abcdefgh replaced_example uvwxyz
</code></pre>

<p>Can I do this with a one-liner in Python? </p>

<p><strong>EDIT:</strong> 
I have a perl one-liner <code>perl -p -i -e 's#example#replaced_example#' text_file.txt</code> but I want to do it in Python too</p>
