博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Tkinter之输入框操作
阅读量:7067 次
发布时间:2019-06-28

本文共 717 字,大约阅读时间需要 2 分钟。

昨天看好的,更新一下记录而已。

 

#coding: utf8from Tkinter import *def reg():    s1 = e1.get()    s2 = e2.get()    t1 = len(s1)    t2 = len(s2)    if s1 == "111" and s2 == "222":        c["text"] = "login success."    else:        c["text"] = "user or password is wrong."        e1.delete(0, t1)        e2.delete(0, t2)root = Tk()root.wm_title("hello")l1 = Label(root, text="username: ")l1.grid(row=0, column=0, sticky=W)e1 = Entry(root)e1.grid(row=0, column=1, sticky=E)l2 = Label(root, text="password: ")l2.grid(row=1, column=0, sticky=W)e2 = Entry(root)e2['show'] = "*"e2.grid(row=1, column=1, sticky=E)b = Button(root, text="Login", command=reg)b.grid(row=2, column=1, sticky=E)c = Label(root, text="")c.grid(row=3)root.mainloop()

转载地址:http://poall.baihongyu.com/

你可能感兴趣的文章
SpringBoot+jsp项目启动出现404
查看>>
Markdown写作中的图床解决方案(基于七牛云、PicGo)
查看>>
通过Spring Boot中的手动Bean定义提高启动性能
查看>>
再次简单明了总结flex布局,一看就懂...
查看>>
一步步学会用docker部署应用(nodejs版)
查看>>
无root权限新建git仓库进行多人协同工作
查看>>
【跃迁之路】【687天】程序员高效学习方法论探索系列(实验阶段444-2019.1.6)...
查看>>
假装用某米赛尔号的角度看Python面向对象编程
查看>>
RGBA和OPACITY的区别&DISPLAY和VISIBILITY的区别
查看>>
膨胀的template class成员函数
查看>>
Flask之flask-mail邮件发送
查看>>
Immutable
查看>>
要提高团队代码质量,就要这么用Git进行版本控制!
查看>>
[LeetCode] 702. Search in a Sorted Array of Unknown Size
查看>>
常用的ES6
查看>>
高级 Vue 组件模式 (5)
查看>>
Nginx负载均衡配置及策略
查看>>
Node 框架接入 ELK 实践总结
查看>>
julia学习笔记:元编程-表达式
查看>>
vector中erase的用法
查看>>