From 8d97382f5eae70938dbeb490679114c8b85e5991 Mon Sep 17 00:00:00 2001 From: HoraK-FDF Date: Fri, 4 Mar 2022 13:34:46 +0100 Subject: chat ignore and some fixes --- utils.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'utils.py') 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!" -- cgit v1.2.3-70-g09d2