python gui界面学习笔记day02
1.定义一个输入窗口
e = tkinter.Entry(window,show="*")
2.定义一个输出窗口
t = tkinter.Text(window,height=2)
实例
import tkinter
window = tkinter.Tk()
window.title('my window')
window.geometry('200x200')
e = tkinter.Entry(window,show="*")
e.pack()
def insert_point():
var = e.get()
t.insert('insert',var)
def insert_end():
var =e.get()
t.insert('end',var)
t = tkinter.Text(window,height=2)
t.pack()
b1 = tkinter.Button(window,text='insert point',width = 15,height=2,command=insert_point)
b2 = tkinter.Button(window,text='inster end',command=insert_end)
b1.pack()
b2.pack()
window.mainloop()