import os
segmentbytes = 5242880
fullbytes = os.path.getsize("Wildlife.wmv")
numframe = fullbytes / segmentbytes
remainder = fullbytes % segmentbytes
parts = [open("Wildlife_Part%i.wmv" %i ,'wb') for i in range(numframe)]
with open("Wildlife.wmv",'rb') as f:
segment = f.read(segmentbytes)
for j in range(numframe):
parts[j].write(segment)
f = open("Segment.txt", "wb")
for i in range(numframe):
f.write("Wildlife_Part%i.wmv" %i + "\r\n")
for f in parts:
` f.close()`
I am working on a project that enables file segmentation. The problem is that when the video get segment into parts, each and every parts shows the same output, when the output is suppose to be each part would show only 1 part of the video.