Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Type text without displaying text

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.

like image 764
user2349129 Avatar asked May 05 '13 02:05

user2349129


2 Answers

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

import getpass
x = getpass.getpass("Input something: ")
print x
like image 185
Yarkee Avatar answered Sep 19 '22 04:09

Yarkee


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

like image 32
Sunjay Varma Avatar answered Sep 19 '22 04:09

Sunjay Varma