我已经开始使用多线程在python中创建一个程序,但是当我运行代码时说错误

时间:2016-04-05 10:28:02

标签: python-3.4

from _thread import*
from time import*
from tkinter import*
timer = 60
root = Tk()
root.geometry('400x400')
output = Label(root,text=timer)

def thread1(timer):
for i in range(59):
    sleep(1)
    output.config(text=timer)
    root.update()
    timer-=1

def thread2():
    for i in range(20):
        text = input('What is your name.\n>>>')
        print('Nice to meet you '+text+'.')


start_new_thread(thread1,(timer,))
start_new_thread(thread2,())
output.pack()

here is a screenshot of the error

我的问题是我哪里出错了 我已经尝试了一个线程的thread1函数,它可以工作。

0 个答案:

没有答案