Representing tuples in strings

Erik Max Francis max at alcyone.com
Mon Oct 29 20:59:43 EST 2001


Graham Ashton wrote:

> I'm looking to convert the tuple:
> 
>   ('string1', 3, 'string2')
> 
> to the string representation:
> 
>   'string1', 3, 'string2'
> 
> without resorting to a regular expression.

', '.join(map(repr, myTuple))

-- 
 Erik Max Francis / max at alcyone.com / http://www.alcyone.com/max/
 __ San Jose, CA, US / 37 20 N 121 53 W / ICQ16063900 / &tSftDotIotE
/  \ Laws are silent in time of war.
\__/ Cicero
    Esperanto reference / http://www.alcyone.com/max/lang/esperanto/
 An Esperanto reference for English speakers.



More information about the Python-list mailing list