I have a Python 2.7 program that converts audiobook files. Since there's a bunch (100-300) of flac files, and I have a shiny, new computer with an i7 processor, I'm working on a multiprocessing version of the program.
I get the list of files using glob, then create a list of tuples...
fis = []
for fi in globlist:
fis.append[(fi, author, title, year, genre)]
I use pool.map(convert, fis) and the program works. WAY faster than the old one-at-a-time version.
Is there a way to create a tuple (author, title, year, genre) in the main function and have it available to the convert function? A dictionary would be fine, too. It doesn't work if I use global variables because I guess child-processes don't inherit anything from the parent in Windows. I'd just rather not have several hundred copies of it in the files list, or waste time recreating it in every child-process.
Thanks.