[Tutor] reading random line from a file

max baseman dos.fool at gmail.com
Sun Jul 15 05:55:22 CEST 2007


im writing a quick quote reader that spits out a random quote from a  
show but cant get it to pick randomly
i tried
a=randrange(820)+1
text.readline(a)

and i would prefer not having to bring evryline into the program then  
picking like

for line in text.readlines():
	lines.append(text)

...



any help would be great thanks 


More information about the Tutor mailing list