当我运行此代码时:
import getpass
p = getpass.getpass(prompt='digite a senha\n')
if p == '12345':
print('YO Paul')
else:
print('BRHHH')
print('O seu input foi:', p) # p = seu input
Run Code Online (Sandbox Code Playgroud)
我收到了这个警告:
Warning (from warnings module):
File "/usr/lib/python3.4/getpass.py", line 63
passwd = fallback_getpass(prompt, stream)
GetPassWarning: Can not control echo on the terminal. Warning: Password input may be echoed.
Run Code Online (Sandbox Code Playgroud)
小智 5
在终端而不是 IDE 中运行代码。您会看到那里不再有警告。要运行代码,请在终端中输入以下命令:
python3 your_program.py
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
15972 次 |
| 最近记录: |