Joseph king wrote: > Hey i was wondering if any one would know if there was a way to have > python randomly read form a file or would you ahve to know the byte > postion and somehow randomize splicing the file so the sentence you > want show's up. > > i.e have a file with a lot of tips and useless facts and then have > python randomly read one sentence when the code is run and print at > any time you would want it to.
import random print random.choice(open("quotes").readlines()) Diez -- http://mail.python.org/mailman/listinfo/python-list