summaryrefslogtreecommitdiff
path: root/utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'utils.py')
-rwxr-xr-xutils.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/utils.py b/utils.py
index 0416a90..f05ece5 100755
--- a/utils.py
+++ b/utils.py
@@ -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!"