diff options
Diffstat (limited to 'snaps/file_utils.py')
-rw-r--r-- | snaps/file_utils.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/snaps/file_utils.py b/snaps/file_utils.py index 819c707..f7c9af4 100644 --- a/snaps/file_utils.py +++ b/snaps/file_utils.py @@ -123,3 +123,16 @@ def read_os_env_file(os_env_filename): # Remove leading and trailing ' & " characters from value out[tokens[0]] = tokens[1].lstrip('\'').lstrip('\"').rstrip('\'').rstrip('\"') return out + + +def read_file(filename): + """ + Returns the contents of a file as a string + :param filename: the name of the file + :return: + """ + out = str() + for line in open(filename): + out += line + + return out |