官术网_书友最值得收藏!

How it works...

The Entry widgets are instantiated using the parent window or frame as the first argument and a set of optional keyword arguments to configure additional options. We did not specify any options for the entry corresponding to the username field. To keep the password secret, we specify the show argument with the string "*", which will display each typed character as an asterisk.

With the get() method, we will retrieve the current text as a string. This is used in the print_login method to show the entries' content in the standard output.

The delete() method takes two arguments that indicate the range of the characters that should be deleted. Keep in mind that the indices start at the position 0, and they do not include the character at the end of the range. If only one argument is passed, it deletes the character at that position.

In the clear_form() method, we delete from index 0 to the constant END, which means that the whole content is removed. Finally, we set the focus to the username entry.

主站蜘蛛池模板: 乌拉特前旗| 湘潭县| 仪陇县| 辛集市| 彩票| 孝昌县| 沿河| 房山区| 永顺县| 宽城| 龙川县| 嵊泗县| 容城县| 革吉县| 托克托县| 炉霍县| 霍林郭勒市| 涟源市| 维西| 淮南市| 黔西县| 龙游县| 察雅县| 崇礼县| 台北市| 尚义县| 满城县| 闵行区| 余干县| 汝阳县| 庆云县| 定陶县| 东乡县| 永新县| 岱山县| 讷河市| 永嘉县| 临清市| 广德县| 玛纳斯县| 紫阳县|