123456789101112131415161718192021222324 |
- #Trial program to practice using Pool class
-
- import multiprocessing as mp
-
-
- process_num = 8
- pool = mp.Pool(processes=process_num)
- files1 = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]
-
- files_list = []
- quenepas_blocksize = len(files1) / process_num
- for x in range(process_num):
- files_list.append(files1[0:quenepas_blocksize])
- files1 = files1[quenepas_blocksize:]
- print files1
- print len(files1)
- print files_list
- for i in files1:
- print files1.index(i)
- print i
- files_list[files1.index(i)].append(i)
-
- print files1
- print files_list
|