to parse chat conversations stored in a file
<pre><code>poem = '''\
me:hello dear
me:hyyy
asha:edaaaa
'''

f=open('poem.txt','r')
arr=[]
arr1=[]
varr=[]
darr=[]
i=0
j=1
for line in f.read().split('\n'):
    arr.append(line)
    i+=1
f.close()
#print arr[0]
#print arr[1]
#print arr[2]

text=arr[0].split(':')
#print text
line=text[0]
#print line
arr1.append(text[1])

for i in range(1,len(arr)):
    text=arr[i].split(':')
    if(line==text[0]):
        #print text[1]
        arr1.append(text[1])
    else:
        if(j==1):
            j+=1
            varr[j]=text[0] # this is not working
            darr[j]=text[1]
            print len(varr)
f.close()
print arr1
</code></pre>
