当前位置:   article > 正文

Tkinter 做简单的窗口视窗 (GUI 莫烦 Python 教程) 3、 Entry & Text 输入_tk.entry(window)

tk.entry(window)

import tkinter as tk
window = tk.Tk()
window.title('my windows')
window.geometry('200x200')
e = tk.Entry(window, show=None) # show="*"
e.pack()

def insert_point():
    var = e.get()
    t.insert('insert',var)

def  insert_end():
    var= e.get()
    t.insert(1.1, var) #1.1是第一行,第一列

b1 =  tk.Button(window, text='insert point', width=15,height=2, command=insert_point)
b1.pack()

b2 = tk.Button(window,text='insert end', command=insert_end)
b2.pack()

t = tk.Text(window, height=2)
t.pack()

window.mainloop()

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Monodyee/article/detail/517129
推荐阅读
相关标签
  

闽ICP备14008679号