Made the word choice code a lot safer
This commit is contained in:
parent
2f387c0444
commit
9ad85ea5e7
|
@ -20,8 +20,7 @@ for font in fonts:
|
||||||
word = ""
|
word = ""
|
||||||
while len(word) < 8:
|
while len(word) < 8:
|
||||||
wllen = subprocess.check_output(["wc", "-l", wordlist]).decode("utf-8").strip().split()[0]
|
wllen = subprocess.check_output(["wc", "-l", wordlist]).decode("utf-8").strip().split()[0]
|
||||||
# Unsafe
|
newword = random.choice(subprocess.check_output(["cat", wordlist]).decode("utf-8").strip().split())
|
||||||
newword = subprocess.check_output(["bash", "-c", "head -n " + str(random.randint(0,int(wllen))) + " " + wordlist + "|tail -n 1"]).decode("utf-8").strip()
|
|
||||||
newword = newword[0].upper() + newword[1:]
|
newword = newword[0].upper() + newword[1:]
|
||||||
if '\'' in newword:
|
if '\'' in newword:
|
||||||
continue
|
continue
|
||||||
|
|
Loading…
Reference in New Issue