如何使用 Tkinter 创建密码输入字段 [英] How to create a password entry field using Tkinter

查看:59
本文介绍了如何使用 Tkinter 创建密码输入字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 Tkinter 编写登录窗口,但我无法隐藏星号格式的密码文本.这意味着密码输入是纯文本,必须避免.知道怎么做吗?

I am trying to code a login window using Tkinter but I'm not able to hide the password text in asterisk format. This means the password entry is plain text, which has to be avoided. Any idea how to do it?

推荐答案

谷歌快速搜索结果

widget = Entry(parent, show="*", width=15)

其中 widget 是文本字段,parent 是父小部件(窗口、框架等),show 是字符回显(即 Entry 中显示的字符),width 是小部件的宽度.

where widget is the text field, parent is the parent widget (a window, a frame, whatever), show is the character to echo (that is the character shown in the Entry) and width is the widget's width.

这篇关于如何使用 Tkinter 创建密码输入字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆