Re: [Tutor] list to string and string to list

2009-04-16 Thread Martin Walsh
Martin Walsh wrote: > johnf wrote: >> On Thursday 16 April 2009 05:04:39 pm Alan Gauld wrote: >>> "johnf" wrote >>> > I want to save the list to the field and when I retrieve the string > convert > it back to a list. > > But this does NOT work. > mylist=[1,2,3,4] > myst

Re: [Tutor] list to string and string to list

2009-04-16 Thread Martin Walsh
johnf wrote: > On Thursday 16 April 2009 05:04:39 pm Alan Gauld wrote: >> "johnf" wrote >> I want to save the list to the field and when I retrieve the string convert it back to a list. But this does NOT work. mylist=[1,2,3,4] mystr=str(mylist) newlist=

Re: [Tutor] list to string and string to list

2009-04-16 Thread johnf
On Thursday 16 April 2009 05:04:39 pm Alan Gauld wrote: > "johnf" wrote > > >> I want to save the list to the field and when I retrieve the string > >> convert > >> it back to a list. > >> > >> But this does NOT work. > >> mylist=[1,2,3,4] > >> mystr=str(mylist) > >> > >> newlist= list(mystr) > >>

Re: [Tutor] list to string and string to list

2009-04-16 Thread Alan Gauld
"johnf" wrote I want to save the list to the field and when I retrieve the string convert it back to a list. But this does NOT work. mylist=[1,2,3,4] mystr=str(mylist) newlist= list(mystr) I keep thinking there must be a simple way of get this done. Is this a good way? newlist = eval(mys

Re: [Tutor] list to string and string to list

2009-04-16 Thread Kent Johnson
On Thu, Apr 16, 2009 at 6:52 PM, johnf wrote: > I am dealing with a database field that can only store strings. > I want to save the list to the field and when I retrieve the string convert it > back to a list. > > But this does NOT work. > mylist=[1,2,3,4] > mystr=str(mylist) > > newlist= list(my

Re: [Tutor] list to string and string to list

2009-04-16 Thread johnf
On Thursday 16 April 2009 03:52:02 pm johnf wrote: > I am dealing with a database field that can only store strings. > I want to save the list to the field and when I retrieve the string convert > it back to a list. > > But this does NOT work. > mylist=[1,2,3,4] > mystr=str(mylist) > > newlist= lis