开发者

Is it possible to make user input invisible as a 'sudo' password input?

开发者 https://www.devze.com 2022-12-16 20:05 出处:网络
I\'m using raw_input() to receive password from user in interactive mode, but I want to make input symbols invisible for security reasons, as it is when you\'re typing your password using sudo or conn

I'm using raw_input() to receive password from user in interactive mode, but I want to make input symbols invisible for security reasons, as it is when you're typing your password using sudo or connect开发者_如何学Pythoning to a database. How I should do it?


You need the getpass module.

from getpass import getpass
password = getpass()
0

精彩评论

暂无评论...
验证码 换一张
取 消