【发布时间】:2014-07-20 12:54:27
【问题描述】:
我在并行化 new_text 为 unicode 类型的那部分代码时遇到了困难:
for old, new in self.replacements:
line = pywikibot.replaceExcept(
line, old, new, self.excsInside, self.site)
if new_text != entry.text:
yield pywikibot.Page(self.site, entry.title)
使用joblib 或process-pool 看起来很容易,但是在循环之外使用了new_text。我不知道#pragama omp ordered或#pragma omp atomic的等价物,因为Python没有OpenMP包装器...
如果 new_next 并行运行,我如何确定 if 语句中的值是多少?
【问题讨论】:
标签: python python-2.7 parallel-processing pywikibot