?
???????Python : 3.7.0
?????????OS : Ubuntu 18.04.1 LTS
????????IDE : PyCharm 2018.2.4
??????Conda : 4.5.11
???typesetting : Markdown
?
code
"""
@Author : 行初心
@Date : 18-10-1
@Blog : www.cnblogs.com/xingchuxin
@Gitee : gitee.com/zhichengjiu
"""
from tkinter import *
def main():
root = Tk()
# e输入框显示字符串:木芙蓉
def _show():
e.insert(0, '木芙蓉')
# 清空e输入框中的内容
def _clear():
e.delete(0, END)
content = StringVar()
e = Entry(root, textvariable=content)
e.pack()
b_show = Button(root, text='显示木芙蓉', command=_show)
b_show.pack()
b_clear = Button(root, text='清空', command=_clear)
b_clear.pack()
mainloop