Minor Changes

New file method

  • f.xreadlines()
  • Allows fast iteration over lines without reading entire file
     f = open("foo")
     i = 0
     for s in f.xreadlines():
         print "%5d: %s" % (i,s),
         i += 1
     
<<< O'Reilly OSCON 2001, New Features in Python 2, Slide 44
July 26, 2001, beazley@cs.uchicago.edu
>>>