I have the following code runnning smoothly in Python 3, and I can't convert it to Python 2.7.
from multiprocessing import *
def func(path, filename, path_2):
#Things to do
for i in range(0,len(chr_names)): #len(chr_names) = 24
tuple_var.append((path, chr_names[i][0], chrom_sizes[i][0]))
cores = 4
with Pool(cores) as p:
p.starmap(func, tuple_var)
I get the following error.
python AttributeError: __exit__
I know starmap is not supported in Python 2.7.
What code should I use in Python 2.7?