def get_login_credentials ( args ) : if not args . username : args . username = raw_input ( "Enter Username: " ) if not args . password : args . password = getpass . getpass ( "Enter Password: " )
python automate entering of credentials
Gets the login credentials from the user if not specified while invoking the script .
def get_login_credentials(args):
  """
    Gets the login credentials from the user, if not specified while invoking
    the script.
    @param args: arguments provided to the script.
    """
  if not args.username:
    args.username = raw_input("Enter Username: ")
  if not args.password:
    args.password = getpass.getpass("Enter Password: ")