gpt4 book ai didi

python - 从 IDLE 运行时为 "GetPassWarning: Can not control echo on the terminal"

转载 作者:太空狗 更新时间:2023-10-29 21:36:31 25 4
gpt4 key购买 nike

当我运行这段代码时:

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

我收到了这个警告:

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.

最佳答案

使用实际的终端 -- 即 stdinstdoutstderr 连接到 /dev/的环境tty,或其他 PTY 兼容设备。

IDLE REPL 不满足此要求。

关于python - 从 IDLE 运行时为 "GetPassWarning: Can not control echo on the terminal",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38878741/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com