开发者社区> 问答> 正文

python label有什么用

python label有什么用

展开
收起
云计算小粉 2018-05-10 20:11:04 4354 0
1 条回答
写回答
取消 提交回答
  • from tkinter import *
    import time
    root = Tk()
    root.geometry('250x150')
    root.title('Hello')
    timestr = StringVar()
    timestr = 'wait'
    l=Label(root,textvariable=timestr).pack()
    a=('a','b','c','d')
    for i in a:
    time.sleep(3)
    timestr.set(i)
    root.update_idletasks()

    root.mainloop()

    我这个为什么会提示出错呢
    Traceback (most recent call last):
    File "G:python_pycache_6666.py", line 12, in
    timestr.set(i)
    AttributeError: 'str' object has no attribute 'set'

    2019-07-17 22:25:10
    赞同 展开评论 打赏
问答分类:
问答标签:
问答地址:
问答排行榜
最热
最新

相关电子书

更多
From Python Scikit-Learn to Sc 立即下载
Data Pre-Processing in Python: 立即下载
双剑合璧-Python和大数据计算平台的结合 立即下载