Re: [Tutor] Lists in a file

2009-04-27 Thread David Holland
Thanks for all the suggestions.  I will have to try this. --- On Sun, 26/4/09, Kent Johnson wrote: From: Kent Johnson Subject: Re: [Tutor] Lists in a file To: "Robert Berman" Cc: "David Holland" , "tutor python" Date: Sunday, 26 April, 2009, 8:04 PM On Sun, A

Re: [Tutor] Lists in a file

2009-04-26 Thread spir
Le Sun, 26 Apr 2009 18:03:41 + (GMT), David Holland s'exprima ainsi: > Hi, > > I am trying to create a program where I open a file full of lists and > process them. However when the program does not recognize the lists as > lists. Here is the relevant code :- > def open_filedef(): >     text

Re: [Tutor] Lists in a file

2009-04-26 Thread Kent Johnson
On Sun, Apr 26, 2009 at 2:18 PM, Robert Berman wrote: > David, > > You are processing a text file. It is your job to treat it as a file > comprised of lists. I think what you are saying is that each line in the > text file is a list. In that case > > for line in fileobject: >   listline = list(lin

Re: [Tutor] Lists in a file

2009-04-26 Thread Robert Berman
David, You are processing a text file. It is your job to treat it as a file comprised of lists. I think what you are saying is that each line in the text file is a list. In that case for line in fileobject: listline = list(line) Now, listline is a list of the text items in line. Hope thi

[Tutor] Lists in a file

2009-04-26 Thread David Holland
Hi, I am trying to create a program where I open a file full of lists and process them. However when the program does not recognize the lists as lists. Here is the relevant code :- def open_filedef():     text_file =open ("voteinp.txt","r")     lines = text_file.readlines()             for line