"max baseman" <[EMAIL PROTECTED]> wrote
> im writing a quick quote reader that spits out a random quote from a > show but cant get it to pick randomly You can either get theclines to be the same length and use a random index to seek() to the start of the line you want. Or you can build a separate index file which records where each line starts and randomly select one of thiose. But that requires that the quotes file is only changed programmatically so that the index file can be rebuilt each time you add/delete a quote. (Or you build an indexing program) Its much easier (unless the file is huge) to just use readlines() HTH Alan G. _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor