Example:
from multiprocessing.dummy import Pool as ThreadPool
def testfunc(string):
print string
def main():
strings = ['one', 'two', 'three', ...]
pool = ThreadPool(10)
results = pool.map(testfunc, strings)
pool.close()
pool.join()
if __name__ == '__main__':
main()
This will not give us clear results with one result in one line:
one
two
three
But mesh, that has random linebreaks, like
one
two
three
four
five
...
Why does it happen? Can i output my data with one linebreak per function call?
P.S. Sometimes i have even no linebreaks or even spaces! P.P.S. Working under windows