making a string copy of a list

Tyler Eaves tyler at tylereaves.com
Sat Jan 13 01:42:23 EST 2001


this should work: (Note: Code not actually tested....)

yourstring=''
for x in yourlist:
	yourstring=yourstring+str(x)+','
#Remove that last comma
yourstring=yourstring[:-1]

On Fri, 12 Jan 2001 22:53:04 -0800, warlock at eskimo.com (Jim
Richardson) wrote:

>OK, I swear I've looked for this, but how do I make a copy of a list, into a
>string, complete with commas seperating the entries in the list? 
>
>
>
>-- 
>Jim Richardson
>	Anarchist, pagan and proud of it
>WWW.eskimo.com/~warlock
>	Linux, because life's too short for a buggy OS.
>




More information about the Python-list mailing list