def processChunk(params):
    filename, chunk_number, number_of_chunks = params
with open(filename, 'r') as fp:
    for line in file_block(fp, number_of_chunks, chunk_number):
        process(line)
li = [(filename, i, number_of_chunks) for i in range(number_of_chunks)]
p.map(processChunk, li)
Python: Process file using multiple cores