I've defined:

def get_contents(infile=file_object):
   """ return a list of lines from a file """
   contents=infile.read()
   contents = contents.strip().split('\n')
   return contents

then there's also:

file_object.read()

and 

file_object.readlines()

and

file_object.readline()

I think I understand the differences, but can someone tell me if there's any
difference between what I define and the readlines() method?

-john
-- 
View this message in context: 
http://www.nabble.com/readlines%2C-read%2C-and-my-own-get_contents%28%29-tp17998300p17998300.html
Sent from the Python - tutor mailing list archive at Nabble.com.

_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to