I have a simple python code, trying to convert a batch of jpg file to png. But this code only spawn one subprocess each time on my linux machine, what's the problem with this code?
from scipy.misc import imread, imsave
from multiprocessing import Process, util
import logging
util.log_to_stderr(level=logging.DEBUG)
def imgcvt(inf, outf):
im=imread(inf)
imsave(outf,im)
for i in range(3):
run_list = [];
threads = [];
for j in range(1,21):
fn = str(i*20+j+1)
run_list.append((fn+".jpg", fn+".png"))
for dev in run_list:
proc = Process(target=imgcvt, args=dev)
proc.start()
proc.join()
thanks