list to string

Nicola Mingotti nicola-mingotti at libero.it
Fri Sep 5 22:47:35 EDT 2003


Lars Behrens <Spam.Buster at web.de> writes:
> 
> Can someone point me a way to change a list with arbitrary number of
> items to a string :
> 
>    vals = ['aaa', 'bbb', 'ccc']
>    valstring = 'aaa, bbb, ccc'
>

# here you import a lot of functions on strings
import string   

vals = ['a','b','c']
valstring = string.join(vals,",")

> Seems easy at the first glance, but...
... it's :) 

bye




More information about the Python-list mailing list