【发布时间】:2017-04-30 20:26:08
【问题描述】:
我正在使用 Python。我正在制作一个脚本,用户必须在终端中输入密码。
我已经在这个网站上找到了使用 getpass 模块的解决方案。
new_password=getpass.getpass(prompt="Type new password: ")
问题是我收到警告,并且密码输入也会显示出来。
Warning (from warnings module):
File "C:\Python34\lib\getpass.py", line 101
return fallback_getpass(prompt, stream)
GetPassWarning: Can not control echo on the terminal.
Warning: Password input may be echoed.
【问题讨论】:
-
getpass.win_getpass()寡妇用这个。 -
很遗憾没有帮助
-
你使用的是IDLE还是windows终端?
-
我正在使用 IDLE
-
IDLE 与 stdout 和 stderr 有问题,尝试使用普通终端 question-1; question-2