1、密码用密文显示需要使用getpass模块,该模块只能通过命令行调用,用图形界面调用报错。代码如下:#!/usr/bin/env pythonimport getpass_username = ‘hexh‘_password = "abc123"username = input("username:")password = getpass.getpass("password:")print(username ,password)显示结果:hexh abc123
时间: 2025-01-07 19:26:36