simple files

Darren Teo darrenteo82 at yahoo.com
Sat May 31 02:18:07 EDT 2003


Hey how come when i do this it just outputs the last line and not the rest of the lines ??? I wish to output each line from file into a seperate list .....
eg. first line ['1', 'yea', '2']
     sec line ['3', 'hi', '4']

def readtable(filename):

   intabfile = open(filename, "r")
   for tablines in intabfile:
      tab = string.split(tablines, ":" ,10)
   intabfile.close()
   return tab

Any help is appreciated.



---------------------------------
Do you Yahoo!?
Free online calendar with sync to Outlook(TM).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20030530/5c91edc0/attachment.html>


More information about the Python-list mailing list