improve adding quotes, improve reading quotes
This commit is contained in:
+1
-2
@@ -1,10 +1,9 @@
|
||||
""" Stan quote generator. """
|
||||
import random
|
||||
|
||||
quotes = [i.rstrip() for i in open('Stan.txt', 'r', encoding='utf8')]
|
||||
|
||||
|
||||
def speak(chance_of):
|
||||
number = random.randint(0, chance_of)
|
||||
if number == 0:
|
||||
quotes = (i.rstrip() for i in open('Stan.txt', 'r', encoding='utf8'))
|
||||
return random.choice(quotes)
|
||||
|
||||
Reference in New Issue
Block a user