当我输入
>>> passwd = getpass.getpass()
进入python 2.7 shell,在IDLE中,我得到结果:
Warning (from warnings module):
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/getpass.py", line 55
passwd = fallback_getpass(prompt, stream)
GetPassWarning: Can not control echo on the terminal.
Warning: Password input may be echoed.
Password:
然后当我输入密码时,它不会被隐藏。我需要将它发送到变量,所以我可以使用sha模块对它进行SHA处理并将其与' SHAed'进行比较。原始
答案 0 :(得分:1)
pass是一个python关键字。请改变像
这样的东西password = getpass.getpass()
然后从shell / console
运行它