Type text without displaying text
Asked Answered
C

2

12

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.

Credo answered 5/5, 2013 at 2:59 Comment(2)
You might want to look into using things like ncurses.Stater
Related: Can i get console input without echo in python?Untried
K
11

getpass work very well either in command prompt or in python script.

import getpass
x = getpass.getpass("Input something: ")
print x
Kristikristian answered 5/5, 2013 at 3:41 Comment(0)
C
2

getpass() doesn't work in IDLE. Try it in command prompt or on the terminal.

Conceit answered 5/5, 2013 at 3:2 Comment(2)
I need something that can do it within the script. So if getpass doesn't work in the IDLE, then I need something elseCredo
Why 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?Metzgar

© 2022 - 2024 — McMap. All rights reserved.