diff options
Diffstat (limited to 'utils.py')
-rwxr-xr-x | utils.py | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -148,3 +148,16 @@ def encode_str(value, size): output += chr(start) return output + +def preloadArray(nfile): + try: + array=[] + file = open(nfile, "r") + for x in file.readlines(): + x = x.replace("\n", "") + x = x.replace("\r", "") + array.append(x) + file.close() + return array + except: + print "preloadArray: File " + nfile + " not found!" |