o
    /`Žc  ã                   @   s2   d Z G dd„ dƒZedkree dd¡ƒ dS dS )zjUtility class for Seven Little Words.

Author CS149 Profesors, James Madison University
Version Fall 2018
c                   @   s   e Zd Zdd„ ZdS )ÚFileUtilitiesc                 C   sZ   z$t | dƒ}| ¡ }t|ƒdkrd}ndd„ |D ƒd|… }| ¡  W |S    d}Y |S )a5  Read and return the given number of lines from the given file.
     
         Args:
            filename(str): The name of the file to read from
            number_of_lines(int): The number of lines to read
    
        Returns:
            (list): The array of lines (or null if there was a problem)
        Úré    Nc                 S   s   g | ]}|  ¡ ‘qS © )Ústrip)Ú.0Úliner   r   úuC:\Users\wangid\OneDrive - James Madison University\2022_Fall\CS149\Homework\PA3\reference_solution\file_utilities.pyÚ
<listcomp>   s    z6FileUtilities.read_lines_from_file.<locals>.<listcomp>)ÚopenÚ	readlinesÚlenÚclose)ÚfilenameZnumber_of_linesÚfÚlinesÚresultr   r   r   Úread_lines_from_file	   s   

ýz"FileUtilities.read_lines_from_fileN)Ú__name__Ú
__module__Ú__qualname__r   r   r   r   r   r      s    r   Ú__main__zjmu.txté   N)Ú__doc__r   r   Úprintr   r   r   r   r   Ú<module>   s
    ÿ