Tkinter Entry only allows digit number
来源:互联网 发布:u盘损坏数据恢复 编辑:程序博客网 时间:2024/05/25 23:56
from Tkinter import *def validatecontent(S): print "S='%s'" % S return (S.isdigit()==bool(S)) #can only input digit number,and must use this format **S**==**S**vcmd=(top.register(validatecontent),'%S') #use S,the text string being inserted# valid percent substitutions (from the Tk entry man page)# %d = Type of action (1=insert, 0=delete, -1 for others)# %i = index of char string to be inserted/deleted, or -1# %P = value of the entry if the edit is# %s = value of entry prior to editing# %S = the text string being inserted or deleted, if any# %v = the type of validation that is currently set# %V = the type of validation that triggered the callback# (key, focusin, focusout, forced)# %W = the tk name of the widgetentry2=Entry(top,textvariable=e2,validate='all',validatecommand=vcmd)entry2.pack()
top.mainloop()
0 0
- Tkinter Entry only allows digit number
- Tkinter:Entry
- tkinter Entry
- tkinter entry组件
- Tkinter之Entry篇
- Tkinter教程之Entry篇
- Python-Tkinter的Entry详解
- Tkinter教程之Entry篇
- tkinter之entry和text
- Tkinter().Entry()的编码问题
- [Tkinter 教程07] Entry 控件
- 小白学tkinter(Entry组件)
- Tkinter中entry的使用示例
- Tkinter entry limit the length of input.
- (转)Python2.7.3 Tkinter Entry(文本框) 说明
- 小白学tkinter(entry的验证函数)
- Python 窗体(tkinter)输入文本框(entry)
- Python tkinter 用例 含button label Entry
- SQLite学习手册(目录)
- Swift源码分析----swift-account-info
- 解决VBOX虚拟机迁移中的虚拟硬盘加载出错问题
- 盘点游戏行业的那些干货网站
- hdu2033 人见人爱A+B
- Tkinter Entry only allows digit number
- Android 适配---notification led 呼吸灯
- 源品汇资讯:绿茵阁、圣农发展有产品检出沙门氏菌
- 【哥德巴赫猜想】
- 在eclipse中查看.class文件
- 1407241738-hd-C语言合法标识符.cpp
- HDOJ 2199 Can you solve this equation?(二分查找法)
- 阶段总结 ———— linux shell 处理命令行参数
- Android-SQLite