code: def password(name, default=None):
      
  
      prompt = name + (default and ' [%s]' % default or '')
      prompt += name.endswith('?') and ' ' or ': '
      while True:
          rv = getpass.getpass(prompt)
          if rv:
              return rv
          if default is not None:
              return default
docs: Grabs hidden (password) input from command line.
  
      :param name: prompt text
      :param default: default value if no input provided.