passing a variable form a loop to a conditional statement
<p>I have got this function in my program.</p>

<pre><code>def time(transcriptionFile) :
    ''' This function changes the time values in secs from the transcription file and keeps a list of start time and duration for each phoneme.'''
    with open("transcriptions.txt", "r") as tFile :
        timeList = []
        parameterList = []
        frame = 0.04
        lines = 0
        for line in tFile :
            lines += 1
            for i in range(lines) : 
                i = i * frame
            timeList.append(i)
            li = line.split()
            if li :
                start_time = (int(li[0]) / 10000000.)
                end_time = (int(li[1]) / 10000000.) 
                duration = ((int(li[1]) -int(li[0]))/10000000.)

                poly = poly_coeff(start_time, end_time, i)
                Newton(poly, parameterList) 
</code></pre>

<p>I want to use <code>i</code> as an argument in <code>poly_coeff</code>. The number of times this function is called is the number of lines in the file. And <code>i</code> is increasing with each line. So when the function is called for the first time the first <code>i</code> value should should be passed as argument then second time the second <code>i</code> value should be passed and so on. </p>

<p>I have certainly done it wrong here I can see but can't figure out how to do it in a right way. Also I guess too much is going on inside a single function. Is it better to split it? But everything is to do with opening the same file.</p>
