Tkinter 怎么累积显示所有过去的输入,比如像下图中,下面的框可以不停的输入数据,上面框显示所有的输入数据
1条回答 默认 最新
- eli261 2020-04-13 01:39关注
#!/usr/bin/python # -*- coding: UTF-8 -*- from Tkinter import * root = Tk() text = Text(root,width=20,height=15) text_input = Text(root,width=20,height=1) def helloCallBack(): text.insert(END, text_input.get("1.0", "end")) B = Button(root, text ="点我", command = helloCallBack) text.pack() text_input.pack() B.pack() text_input.insert(END, "hello") root.mainloop()
解决 无用评论 打赏 举报