getpass模块

#!/usr/bin/env python
# -*- coding:utf-8 -*-
import getpass
#不回显
password = getpass.getpass()
print(password)​