5

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.

2 Answers2

25

Use getpass.

import getpass
keys = getpass.getpass("String here: ")
Cong Ma
  • 10,692
  • 3
  • 31
  • 47
0

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 :")
Chintak
  • 61
  • 5