def read_script(file):
    """
    Opens a namelist file within a context manager.

    Parameters
    ----------
    :param file: string
        Path to the namelist file you wish to open.
    :return: file object
    """
    with open(file, 'r') as script:
        return script.read()