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   sN   zt | dƒ}| ¡ }t|ƒdkrd}W |S 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   ú€/Users/chaoaj/Library/CloudStorage/OneDrive-JamesMadisonUniversity/code/pa-3-seven-word-gui/reference_solution/file_utilities.pyÚ
<listcomp>   s    z6FileUtilities.read_lines_from_file.<locals>.<listcomp>)ÚopenÚ	readlinesÚlen)Ú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
    ÿ