On Fri, 7 Jan 2011 18:42:45 -0800 (PST), John <jlsp...@gmail.com> wrote: >>>> q_file = open(questions_location) #opens the document successfully >>>> for line in q_file: > print line > > # prints document successfully >>>> line > # prints last line of document >>>> for line in q_file: > print line # prints nothing > > ...why does it print nothing?
open(filename) returns an iterator, not a list. Once you have exhausted the iterator, it stays exhausted. -- To email me, substitute nowhere->spamcop, invalid->net. -- http://mail.python.org/mailman/listinfo/python-list