code: def getpassword(prompt="Password: "):
      
  
      fd = sys.stdin.fileno()
      old = termios.tcgetattr(fd)
      new = termios.tcgetattr(fd)
      new[3] &= ~termios.ECHO          # lflags
      try:
          termios.tcsetattr(fd, termios.TCSADRAIN, new)
          passwd = raw_input(prompt)
      finally:
          termios.tcsetattr(fd, termios.TCSADRAIN, old)
      return passwd
docs: get user input without echo