How can I store in a variable certain lines in python?
<p>I have this code: </p>

<pre><code>with open("/etc/network/interfaces", "r") as file:
    content = file.read()
    print content
</code></pre>

<p>it's working and showing this:</p>

<p><a href="http://i.stack.imgur.com/Zauen.png" rel="nofollow"><img src="http://i.stack.imgur.com/Zauen.png" alt="enter image description here"></a></p>

<p>How can I store in a variable any word and print that word?</p>

<pre><code>with open("/etc/network/interfaces", "r") as file:
for line in file:
    words=line.split(' ')#break the line into a list of words.
    print(words[0],words[1]) #
</code></pre>

<p>I have not tested it, but gives you an idea.</p>

python linux python-2.7 python-3.x debian