Sep-26-2018, 10:10 AM
(Sep-25-2018, 04:46 AM)woooee Wrote: Something like this. It is very late and I am very tired so you will have to correct any typos or other errors
def use_mult_process(): from multiprocessing import Process ## byu_dir has not been declares files_list=os.listdir(os.path.join(str3, "010/")) process_list=[] for f in file_list: full_path=os.path.join(str3, "010/", f) if os.path.isfile(full_path): ## not a dir ## send one file only to the function, and ## it is a file and not a dir q = Process(target=build_dict_json, args=(full_path,)) q.start() process_list.append(q) for q in process_list: q.join()
Thanks but that only sped things up from 15 seconds to 12.