import pickle


def read_solver(filename):
    """
    This function reads a .pk1 file.

    Parameters:
        filename (str): A file name or path to file excluding file extension.

    Returns:
        Content of the loaded .pk1 file.
    """
    try:
        file = open(filename+'.pk1', 'rb')
    except IOError:
        print('unable to open file')
        return False
    else:
        solver_obj = pickle.load(file)
        file.close()
        return solver_obj