summaryrefslogtreecommitdiff
path: root/utils.py
diff options
context:
space:
mode:
authorLivio Recchia <recchialivio@libero.it>2022-03-04 19:34:59 +0000
committerLivio Recchia <recchialivio@libero.it>2022-03-04 19:34:59 +0000
commit12d74427740b9601de42786c78b4d71bf1187ef1 (patch)
tree3b0a246d06456756b9a9adc6c97d27e952e6a570 /utils.py
parent728ba8aa6255fa2b8be2cfc759ba202a1a712504 (diff)
parentd60a13c21c5a2d22e7090dce6ecd74db5038f7d8 (diff)
downloadmanachat-12d74427740b9601de42786c78b4d71bf1187ef1.tar.gz
manachat-12d74427740b9601de42786c78b4d71bf1187ef1.tar.bz2
manachat-12d74427740b9601de42786c78b4d71bf1187ef1.tar.xz
manachat-12d74427740b9601de42786c78b4d71bf1187ef1.zip
Merge branch 'chat_ignore_and_fix' into 'master'
chat ignore and some fixes See merge request liviorecchia/manachat!5
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!"