TA的每日心情 | 无聊 2 小时前 |
---|
签到天数: 528 天 连续签到: 1 天 [LV.9]测试副司令
|
1测试积点
1.新建一个gui窗口
- from tkinter import *
- root = Tk()
- text = Text(root,width=200,height=150)
- text.pack()
- root.mainloop()
复制代码 2.测试函数
- import logging
- from time import sleep
- def test():
- for i in range(50):
- logging.info('test log %d'%i)
- sleep(1)
- pr = logging.StreamHandler()
- logging.basicConfig(level=logging.INFO, handlers=[pr, ],
- format="%(asctime)s,%(name)s,%(levelname)s : %(message)s"
- )
- if __name__ == '__main__':
- test()
复制代码 3.求大佬指导如何运行GUI时,logging中打印一条日志,Text控件中就显示一条
|
|