python getpass模块:隐藏不显示输入的密码
2024-10-18 13:13:36
不知道为什么,本机测试必须要在debug模式下才正常运行。。
import getpass #用于隐藏用户输入的字符串,常用来接收密码 def checkuser(user,passwd):
if user == 'chenhang' and passwd == '':
return True
else:
return False if __name__ == "__main__":
userr = input('Input the user:')
passwdd = getpass.getpass('Input the passwd:') if checkuser(userr,passwdd):
print('OK!')
else:
print('ERROR!')
最新文章
- iOS 数字字符串的直接运算 + - * /
- jquery效果- 显示和隐藏 淡入淡出 滑动 隐藏
- html/css 两个div在同一行
- js html5 仿微信摇一摇
- CATransform3D参数的意义
- POJ 1279 Art Gallery 半平面交求多边形核
- 使用delimiter //,解决mysql end报错问题
- 23)django-缓存
- oc字符串与c字符串转换和拷贝
- Maven入门详情
- 从 Azure 下载 Windows VHD
- vue 文本比较插件
- Android Studio - No toolchains found in the NDK toolchains folder for ABI with prefix: mips64el-linux-android
- 视音频数据处理入门:UDP-RTP协议解析
- oracle 存储过程循环体中的return和exit区别:
- 演示-JQuery中伪元素和伪类选择器
- 使用Dreamweaver开发php
- SharePoint 2013 - Host-named Site Collection
- JSON初体验(三):FastJson解析
- .net EF框架