Created
          April 19, 2019 01:02 
        
      - 
      
 - 
        
Save IngIeoAndSpare/d494069238ecb164c6bbce5d2aef31ee to your computer and use it in GitHub Desktop.  
    fileRead code
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | import os | |
| def changeFilePath(file_path): | |
| os.chdir(file_path) | |
| def readFile(file_name) : | |
| file_data = [] | |
| file_object = open(file_name, 'r') | |
| while True: | |
| line_value = file_object.readline() | |
| if not line_value: | |
| break | |
| file_data.append(line_value.strip()) | |
| return file_data | |
| def readFileHandler(file_name, file_path): | |
| changeFilePath(file_path) | |
| file_content = readFile(file_name) | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment