In article <slrn9dk6ga.98l.warlock at gargoyle.myth>, "Jim Richardson" <warlock at eskimo.com> wrote: > I am stumped, str(listname) returns a string of list, but includes the > commas and [] that the list would show if printed. I want a string copy of a > list, is there a simple way I have missed? please? thanks How about this: list = ['foo', 'bar', 'baz', 'quux'] import string stringified = string.join(map(str, list), " ") stringified is now 'foo bar baz quux'. You can of course change the join parameter to whatever you want to use to join the fields together. The reason that map(str, list) is needed is that the items in the list may not be strings. You can't for example do this legally: string.join([1,2,3,4], " ") becuase those numbers aren't strings. So mapping the list with str fixes that problem. -- David Allen http://opop.nols.com/ ---------------------------------------- "Practice random senselessness and act kind of beautiful." -- James Craig Burley
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4