相关疑难解决方法(0)

在Python中获取命令行密码输入

你知道如何在Linux中尝试一些Sudo的东西它会告诉你输入密码,当你输入时,终端窗口中没有显示任何内容(密码没有显示)?

有没有办法在Python中做到这一点?我正在编写一个需要如此敏感信息的脚本,并希望在我输入时隐藏它.

换句话说,我想从用户那里获取密码而不显示密码.

python passwords command-line

204
推荐指数
4
解决办法
18万
查看次数

从终端检测python中键盘输入的最简单方法是什么?

I have a simple python script, that has some functions that run in a loop (I'm taking sensor readings).

while True:
    print "Doing a function"
Run Code Online (Sandbox Code Playgroud)

If the keyboard is pressed I'd like to print "key pressed".

What's the simplest way of doing this in Python? I've searched high and low. I've found out how to do it with pygame, but I'd rather do it without. If I do have to use pygame is it possible to not have a separate …

python keyboard terminal

49
推荐指数
7
解决办法
12万
查看次数

如何在输入密码时将密码转换为星号?

有没有一种方法可以在用户输入星号时转换字符,就像在许多网站上看到的那样?

例如,如果要求电子邮件用户登录其帐户,则在输入密码时,它不会显示为字符,而是显示*在每个单独的笔划之后,没有任何时间延迟.

如果是实际密码KermitTheFrog,则会*************在输入时显示.

python

13
推荐指数
3
解决办法
2万
查看次数

标签 统计

python ×3

command-line ×1

keyboard ×1

passwords ×1

terminal ×1