如何在不冻结程序的情况下更新tkinter标签

时间:2020-04-11 05:10:49

标签: python tkinter

var.set('writing'+title)
label_2 = Label(root,textvariable = var).grid(row=3,column = 0,columnspan =2)
#label_2 = Label(root,text= 'writing'+title).grid(row=3,column = 0,columnspan =2)
for link,title in zip(links,titles):

    link = str(link)
    if link.endswith('.html'):
        texts = get_content(premap + link)
        outfile.write(title)

        count += 1

        var.set('writing'+title)

        for text in texts:

            text = text.strip()
            outfile.write(text+'\n')
        outfile.write('\n'*5)
    #root.update_idletasks()

我尝试使用文本变量方法更新标签,但是似乎界面只会冻结,但是程序仍在运行

0 个答案:

没有答案