I need something like raw_input
, but without displaying the text you are typing.
Also I tried getpass
, but it still displays what I just typed.
Asked
Active
Viewed 7,779 times
12

Xantium
- 11,201
- 10
- 62
- 89

user2349129
- 123
- 1
- 6
-
You might want to look into using things like `ncurses`. – exists-forall May 05 '13 at 03:03
-
Related: [Can i get console input without echo in python?](/q/4616813/4518341) – wjandrea May 31 '23 at 18:45
2 Answers
11
getpass
work very well either in command prompt or in python script.
import getpass
x = getpass.getpass("Input something: ")
print x

Yarkee
- 9,086
- 5
- 28
- 29
2
getpass()
doesn't work in IDLE. Try it in command prompt or on the terminal.

Xantium
- 11,201
- 10
- 62
- 89

Sunjay Varma
- 5,007
- 6
- 34
- 51
-
I need something that can do it within the script. So if getpass doesn't work in the IDLE, then I need something else – user2349129 May 05 '13 at 03:04
-
1Why exactly is this necessary to take an input in the script, but not display it? `getpass()` works very well in every application I can think of, so what exactly are you using this for? – Ryan Saxe May 05 '13 at 03:17