if __name__ == '__main__':
    mypath = 'some/path/'
inputDir = mypath + 'dirA/'
outputDir = mypath + 'dirB/'
p = Pool(12)
p.map(process_file, listdir(inputDir))
Python - How to parallel consume and operate on files in a directory