找不到如何在TKINTER条目框中格式化电话号码
我将python 3.9与tkinter一起使用。我想创建一个TTK.Entry小部件,当将电话号码输入为10个污染物的字符串时,它将自动插入()(例如(555)234-2299)。我正在使用的是可能的吗?
I use Python 3.9 with Tkinter. I would like to create an ttk.Entry widget that would, when a Phone Number is inputted as a string of 10 intigers will automatically insert the () such as (555)234-2299. Is this possible with what I am using?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
添加名称空间
导入RE
。代码:
结果输出:
(555)234-2299
Add namespace
import re
.Code:
Result output:
(555)234-2299