晚上不刷牙 2020-04-12 23:48 采纳率: 0%
浏览 59
已结题

Tkinter 怎么累积显示所有过去的输入

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()
    
    
    评论

报告相同问题?

悬赏问题

  • ¥15 js调用html页面需要隐藏某个按钮
  • ¥15 ads仿真结果在圆图上是怎么读数的
  • ¥20 Cotex M3的调试和程序执行方式是什么样的?
  • ¥15 一道python难题3
  • ¥15 牛顿斯科特系数表表示
  • ¥15 arduino 步进电机
  • ¥20 程序进入HardFault_Handler
  • ¥15 oracle集群安装出bug
  • ¥15 关于#python#的问题:自动化测试
  • ¥20 问题请教!vue项目关于Nginx配置nonce安全策略的问题