filename = "*****.***"
BUFF_LEN = 1000
def ReadGen(genFile):
while(True):
buff = genFile.read(BUFF_LEN)
if not buff: return
yield buff
for i, buff in enumerate(ReadGen(open(filename, "rb"))):
open(str(i) + '_' + filename, "wb").write(buff)
filename = "*****.***"
BUFF_LEN = 1000
def ReadGen(genFile):
while(True):
buff = genFile.read(BUFF_LEN)
if not buff: return
yield buff
for i, buff in enumerate(ReadGen(open(filename, "rb"))):
open(str(i) + '_' + filename, "wb").write(buff)
f = open("test.txt", "w")
for i in range(10000):
f.write("Fish\n")
f.close()
f = open("test.txt", "r")
f_ = open("test_.txt", "w")
data = f.read(1000)
f_.write(data)
f_.close()
f.close()