1. 程式人生 > >py3中輸入密碼時隱藏

py3中輸入密碼時隱藏

python

# -*- coding:utf-8 -*- # Auther:Leon import getpass user=input("請輸入賬號:") pwd=getpass.getpass("請輸入密碼:") if user == "leon" and pwd == "leon" : print("logs-in successfully") else: print("Username or Password NG")

ps:

Python實現星號遮掩的密碼輸入參考:http://blog.csdn.net/sbdxxcjh/article/details/39120095



py3中輸入密碼時隱藏