- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
def getListOf(points):
i=1
f=open('Welcome_sub.srt', 'a')
for point in points:
print "%d" % i
f.write(str(i)+'\n')
begin = point.getAttribute('begin').split(':')
dur = point.getAttribute('dur').split(':')
h=str( (int(begin[0])+int(dur[0])) if (int(begin[0])+int(dur[0]))>10 else '0'+str(int(begin[0])+int(dur[0])) )
m=str(int(begin[1])+int(dur[1])) if (int(begin[1])+int(dur[1]))>10 else '0'+str(int(begin[1])+int(dur[1]))
f.write(point.getAttribute('begin')+' --> '+''.join(h+':'+m+':'+str(float(begin[2])+float(dur[2])) )+'\n')
print "%s -->%s" % (point.getAttribute('begin'), ''.join(h+':'+m+':'+str(float(begin[2])+float(dur[2])) ))
f.write(getText(point.childNodes)+'\n')
print "%s" % getText(point.childNodes)
i+=1