Пример #1
0
 def getanswer(self, hour):
     hour = int(hour)
     length = len(self.answers[hour])
     answer = ""
     if length > 0:
         answer = self.answers[hour][pseudorand(length) - 1]
     return answer
Пример #2
0
def getline(path, hour):
	f = open(path + str(hour) + ".txt", "r")
	lines = f.read().splitlines()
	f.close()
	length = len(lines) + 1
	answer = ""

	if(length > 1):
		rand = int(seeder.pseudorand(length))
		answer = lines[rand]
	return answer