Message321856
| Author | Windson Yang |
|---|---|
| Recipients | Windson Yang, methane, xiang.zhang, zach.ware |
| Date | 2018-07-18.03:52:33 |
| SpamBayes Score | -1.0 |
| Marked as misclassified | Yes |
| Message-id | <1531885953.63.0.56676864532.issue34134@psf.upfronthosting.co.za> |
| In-reply-to |
| Content | |
|---|---|
The code didn't work with imap because imap create a generator, so we can't access result outside the with statement.
with Pool(os.cpu_count()) as p:
result = p.imap(clean_up, k, 50)
for r in result:
print(r)
In https://docs.python.org/3.4/library/multiprocessing.html?highlight=process#using-a-pool-of-workers I found the correct example. I'm not sure should me add example or warning in imap function. |
|
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2018-07-18 03:52:33 | Windson Yang | set | recipients: + Windson Yang, methane, zach.ware, xiang.zhang |
| 2018-07-18 03:52:33 | Windson Yang | set | messageid: <1531885953.63.0.56676864532.issue34134@psf.upfronthosting.co.za> |
| 2018-07-18 03:52:33 | Windson Yang | link | issue34134 messages |
| 2018-07-18 03:52:33 | Windson Yang | create | |