bugfix: index fact list properly

This commit is contained in:
Brian S. Stephan 2010-07-29 19:46:58 -05:00
parent 632f89e61c
commit f7cb0fd05a

View File

@ -44,7 +44,7 @@ class FactFile(Module):
# http://www.regexprn.com/2008/11/read-random-line-in-large-file-in.html # http://www.regexprn.com/2008/11/read-random-line-in-large-file-in.html
with open(filename, 'r') as file: with open(filename, 'r') as file:
facts = file.readlines() facts = file.readlines()
to_print = facts[random.randint(0, len(facts))] to_print = facts[random.randint(1, len(facts))-1]
# return text # return text
if replypath is None: if replypath is None: