SIZE_HINT = 80 * 40000
fileNumber = 0
with open('inputFile.txt', 'rt') as f:
    while True:
        buf = f.readlines(SIZE_HINT)
if not buf:
    break
outFile = open('outFile%d.txt' % fileNumber, 'wt')
outFile.write(buf)
outFile.close()
fileNumber += 1
Split large files using python