from tkinter import * window = Tk() window.title("myEntry") window.geometry('+400+600') # 输入的文本变为* 内容不可见 和QLineEdit 差不多 e=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) b1 = Button(window,text = 'insert point',width = 15,height=2,command=insert_point) b1.pack() b2 = Button(window,text = 'insert end',width = 15,height =2,command = insert_end) b2.pack() t = Text(window,height=2) t.pack() window.mainloop()