File operations in Python
<p>I have a piece of code which extracts a string that lies between two strings.However,this script performs this operation only on a line.I want to perform this operation on a complete file and get a list of all the words lying between those two words.</p>

<p>Note:The two words are fixed.For ex:If my code is something like </p>

<pre><code>'const int variablename=1'
</code></pre>

<p>then I want a list of all the words in the file lying between <code>'int'</code> and <code>'='</code>.
Here is the current script:</p>

<pre><code>s='const int variablename = 1'

k=s[s.find('int')+4:s.find('=')]

print k
</code></pre>
