_getpass.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:cbtnuggets-dl 作者: r0oth3x49 项目源码 文件源码
def getpass(self, prompt='Password : ', stream=None):
        """Prompt for password with echo off, using Unix getch()."""
        password = ""
        sys.stdout.write(prompt)
        while True:
            c = _win_getch() if os.name == 'nt' else self._unix_getch()
            if c == '\r' or c == '\n':
                break
            if c == '\003':
                raise KeyboardInterrupt
            if c == '\b':
                c = ''
            password += c
            sys.stdout.write("*")

        return password
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号