Re: int to str in list elements..

2007-10-16 Thread John Machin
Marc 'BlackJack' Rintsch wrote: > On Tue, 16 Oct 2007 06:18:51 +, Tim Roberts wrote: > > > John Machin <[EMAIL PROTECTED]> wrote: > >>On Oct 15, 4:02 am, Abandoned <[EMAIL PROTECTED]> wrote: > >>> Hi.. > >>> I have a list as a=[1, 2, 3 ] (4 million elements) > >>> and > >>> b=",".join(a)

Re: int to str in list elements..

2007-10-16 Thread Marc 'BlackJack' Rintsch
On Tue, 16 Oct 2007 06:18:51 +, Tim Roberts wrote: > John Machin <[EMAIL PROTECTED]> wrote: >>On Oct 15, 4:02 am, Abandoned <[EMAIL PROTECTED]> wrote: >>> Hi.. >>> I have a list as a=[1, 2, 3 ] (4 million elements) >>> and >>> b=",".join(a) >>> than >>> TypeError: sequence item 0: expecte

Re: int to str in list elements..

2007-10-15 Thread Tim Roberts
John Machin <[EMAIL PROTECTED]> wrote: >On Oct 15, 4:02 am, Abandoned <[EMAIL PROTECTED]> wrote: >> Hi.. >> I have a list as a=[1, 2, 3 ] (4 million elements) >> and >> b=",".join(a) >> than >> TypeError: sequence item 0: expected string, int found >> I want to change list to a=['1','2','3']

Re: int to str in list elements..

2007-10-14 Thread Alex Martelli
Abandoned <[EMAIL PROTECTED]> wrote: > Hi.. > I have a list as a=[1, 2, 3 ] (4 million elements) > and > b=",".join(a) > than > TypeError: sequence item 0: expected string, int found > I want to change list to a=['1','2','3'] but i don't want to use FOR > because my list very very big. > I'm

Re: int to str in list elements..

2007-10-14 Thread John Machin
On Oct 15, 4:02 am, Abandoned <[EMAIL PROTECTED]> wrote: > Hi.. > I have a list as a=[1, 2, 3 ] (4 million elements) > and > b=",".join(a) > than > TypeError: sequence item 0: expected string, int found > I want to change list to a=['1','2','3'] but i don't want to use FOR > because my list v

Re: int to str in list elements..

2007-10-14 Thread Tobias K.
1. Use a generator expression: b = ",".join(str(i) for i in a) or 2. Use imap from itertools import imap b = ",".join(imap(str, a)) -- http://mail.python.org/mailman/listinfo/python-list

int to str in list elements..

2007-10-14 Thread Abandoned
Hi.. I have a list as a=[1, 2, 3 ] (4 million elements) and b=",".join(a) than TypeError: sequence item 0: expected string, int found I want to change list to a=['1','2','3'] but i don't want to use FOR because my list very very big. I'm sorry my bad english. King regards -- http://mail.pyt