Re: [Tutor] lists strings and files

2005-11-09 Thread Kent Johnson
Michael Haft wrote: > Hello, > thanks for all the help with lists and strings, the list I have has > nested sublists in it though. How do I remove these or is there a way > to convert from lists to strings without removing them? > > The code looks something like: > > result = [] > data = [fi

Re: [Tutor] lists strings and files

2005-11-09 Thread Hugo González Monteverde
Have you tried pickling them? If you want it to be flattened, so that result is: [fields[1], fields[2], fields[3]] instead of [[fields[1], fields[2], fields[3]]] you should use the extend method instead of the append method. Hugo Michael Haft wrote: > Hello, > thanks for all the help wi

[Tutor] lists strings and files

2005-11-09 Thread Michael Haft
Hello, thanks for all the help with lists and strings, the list I have has nested sublists in it though. How do I remove these or is there a way to convert from lists to strings without removing them? The code looks something like: result = [] data = [fields[1] fields[3] fields[7]] result.ap