美文网首页
python : valueerror: unknown el

python : valueerror: unknown el

作者: 夏天不热也不冷 | 来源:发表于2019-10-25 14:22 被阅读0次

    matplotlib 是进程安全的,不是线程安全的。
    应该使用python的multiprocessing.Pool,而不是ThreadPool。

    import multiprocessing
    pool=multiprocessing.Pool(processes=10) # processes可以调用的core数目
    for i in range(0,357):
          pool.map(fitting, filenames[i*10:i*10+10])
    pool.close() # 一定要在for循环的外面
    pool.join() #要在for循环的外面
    

    https://stackoverflow.com/questions/55179881/multithreading-matplotlib-graph-in-a-kivy-app

    相关文章

      网友评论

          本文标题:python : valueerror: unknown el

          本文链接:https://www.haomeiwen.com/subject/qkmsvctx.html