diff --git a/common/file.py b/common/file.py index 8d042c575685adad2a3284cb96995c06778ee66b..c08695434ceab80c5f44075be7c122f49d064f7c 100644 --- a/common/file.py +++ b/common/file.py @@ -70,3 +70,10 @@ class FileOperation: dist_list.append(i) i = i + 1 return dist_list + + @staticmethod + def readfile(filename): + txt = '' + with io.open(file = filename, mode = 'r', encoding = 'utf-8') as fp: + txt = fp.read() + return txt