示例#1
0
文件: User.py 项目: djohsson/imouto
 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