Learning Python: Find and Add value inside file
<p>I want to find last value (ie. <code>lo:</code>) and just append a value to this.
ie.
 i want to find the <code>lo:3</code>, in this case my last value and append a <code>lo:4</code></p>

<p>File:</p>

<pre><code>ifconfig lo:1
 address x.x.x.x
 netmask x.x.x.x
 gateway x.x.x.x

ifconfig lo:2
 address x.x.x.x
 netmask x.x.x.x
 gateway x.x.x.x

ifconfig lo:3
 address x.x.x.x
 netmask x.x.x.x
 gateway x.x.x.x
</code></pre>

<p>What is the best way to do ? Split or Loop + Readline with check.</p>
