小编Ahm*_*gih的帖子

getpass 不适用于 spyder (Python)

我正在尝试使用 getpass 来隐藏输入,但它只是给了我这个错误:

“警告:QtConsole 不支持密码模式,您输入的文本将可见。”

我正在使用 Spyder。这是我的代码:

import getpass

pswd = getpass.getpass('Password:')

if pswd== 'whatever':
   print ('\nACCESS GRANTED') 
else:
   print('\nACCESS DENITED')
Run Code Online (Sandbox Code Playgroud)

python spyder getpass

6
推荐指数
2
解决办法
5032
查看次数

标签 统计

getpass ×1

python ×1

spyder ×1