On Sun, Oct 25, 2009 at 6:53 PM, Katt <[email protected]> wrote: > Hello all, > > Currently I am working on a program that reads text from a text file. I > would like it to place the information int a list and inside the information > would have sublists of information. > > The text file looks like this: > > "Old Test","2009_10_20" > "Current Test","2009_10_25" > "Future Test","2009_11_01" > > I am trying to get the list of lists to look like the following after the > information is read from the text file: > > important_dates = [["Old Test","2009_10_20"],["Current > Test",2009_10_25"],["Future Test","2009_11_01"]]
Take a look at the csv module in the standard lib. You can configure it to use comma as the delimiter and it will handle the quotes for you. Kent _______________________________________________ Tutor maillist - [email protected] To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor
