重庆分公司,新征程启航

为企业提供网站建设、域名注册、服务器等服务

tkinter_Entry和text-创新互联

#encoding=utf-8
import tkinter as tk
#创建窗口,设置标题,大小
window = tk.Tk()
window.title("我的窗口")
window.geometry("400x200")

#创建一个Entry输入框,输入框输入字符以星号展示,show=None,展示原文,show="1"
#展示1
entry = tk.Entry(window,show="*")
entry.pack()

#定义函数:获取Entry输入框的内容并且插入到text文本框中
#插入到text文本框的当前光标位置
def insert_point():
    entry_content = entry.get()
    text.insert("insert",entry_content)#text.insert("1.1",entry_content)插入到text文本框1行1列位置

#定义函数:获取Entry输入框的内容并且插入到text文本框中
#插入到text文本框的末尾
def insert_end():
    entry_content = entry.get()
    text.insert("end",entry_content)

#创建Button,执行insert_point函数
button_1 = tk.Button(window,text="insert point",width=15,height=2,font=10,command = insert_point)
button_1.pack()
#创建Button,执行insert_end数
button_2 = tk.Button(window,text="insert end",width=15,height=2,font=12,command=insert_end)
button_2.pack()

#创建Text输入框
text = tk.Text(window,width=20,height=2)
text.pack()

#循环检测窗口
window.mainloop()

另外有需要云服务器可以了解下创新互联scvps.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。

创新互联网络公司拥有十余年的成都网站开发建设经验,上千家客户的共同信赖。提供网站建设、做网站、网站开发、网站定制、买链接、建网站、网站搭建、响应式网站开发、网页设计师打造企业风格,提供周到的售前咨询和贴心的售后服务
标题名称:tkinter_Entry和text-创新互联
网页链接:http://cqcxhl.cn/article/ioseg.html

其他资讯

在线咨询
服务热线
服务热线:028-86922220
TOP