numerical calculations with the items in a list
<p>I am back again with another python query. I have been trying to do some calculations with the items present in a list. Here is the code:</p>

<pre><code>import math

def Usage() :
    print "Usage :python beznew.py transcriptionsFile"

if __name__ == "__main__" :

    if len(sys.argv) != 2 : 
        Usage() 

    else :
        transcriptionFile = sys.argv[1]
        tFile = open(transcriptionFile, "r")

        for line in iter(tFile) :
            list = line.split()

            # changing the unit of time from 100 nano seconds to seconds
            list[0] = list[0] / 100000000
            list[1] = list[1] / 100000000

            # duration of each phoneme
            list = list[1] - list[0]

            # extracting the start time of each phoneme
            newlist = list.pop[0]    

            print list
            print newlist

        close.tFile 
</code></pre>

<p>The input file looks like the following:</p>

<pre><code>000000 1200000 pau

1200000 1600000 dh

1600000 2000000 ih

2000000 3100000 k

3100000 3400000 aa

3400000 3800000 r
</code></pre>

<p>I am trying to change the numerical values to seconds. And also trying to get the difference between first and second numbers. It would not allow me to divide. I dont understand what am I doing wrong. Thank you.  </p>
