首页 > 解决方案 > AttributeError:“dict_values”对象没有属性“更新”

问题描述

我有问题:“AttributeError:'dict_values'对象没有属性'update'”

我该如何解决?

代码 :

queue = Queue()
    liste = glob(f+'/2013/*.xml')[:30]
    # l1 = Manager().list
    # l2
    # # for fic in liste : 
    #   grosse_bc = main(fic,listeIngr,listeAll,grosse_bc)
    # for i in range (50): 
    #   main(liste[i],listeIngr,listeAll,grosse_bc)
    while len(liste) >= 15 :
        for i in range(15):
            p = multiprocessing.Process(target=main, args=(liste[i],listeIngr,listeAll,queue,grosse_bc))
            jobs.append(p)
            p.start()
        liste = liste[14:]
    print("fini !")
    # for p in jobs :
    #   # grosse_bc.update(p)
    #   p.join()
    # print("join fini !")
    gros_dico = []
    # queue.join()
    x = 0
    tgd = {}
    while not queue.empty():
        # gros_dico.append(queue.get())
        for elem in queue.get():
            if elem not in tgd :
                tgd[elem] = queue.get().values()
            else : 
                tgd[elem].update(queue.get().values())
    # print(gros_dico)
    # for elem in gros_dico :
    #   tgd.update(elem)
    pprint(tgd)

我想连接队列输出的所有字典。最佳莱昂

标签: pythonpython-3.xdictionarypython-multiprocessing

解决方案


推荐阅读