user5354933
user5354933

Reputation:

Python 2.7 - how to get input, but don't show keys entered

I want to make it so that I'm taking input

enterKey = raw_input("String here: ")

But that any keys entered are not displayed - it should just act as a pause of sorts in the script until Enter/Return is pressed and then it can proceed.

Upvotes: 5

Views: 7112

Answers (2)

Chintak
Chintak

Reputation: 53

getpass : Prompts use to enter keys but it don't displays it.

You can use it as An interactive CLI Python program, which requires entering of password.

import getpass
key = getpass.getpass("enter Key :")

Upvotes: 0

Cong Ma
Cong Ma

Reputation: 11322

Use getpass.

import getpass
keys = getpass.getpass("String here: ")

Upvotes: 25

Related Questions