答复: 答复: how to remove \n in the list

2008-04-14 Thread Penny Y.
that's right. got it thanks. -邮件原件- 发件人: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 代表 Eric Brunel 发送时间: 2008年4月14日 16:17 收件人: python-list@python.org 主题: Re: 答复: how to remove \n in the list (please avoid top-posting... corrected) On Mon, 14 Apr 2008 09:08:06 +0200, Penny Y. &l

Re: 答复: how to remove \n in the list

2008-04-14 Thread Eric Brunel
(please avoid top-posting... corrected) On Mon, 14 Apr 2008 09:08:06 +0200, Penny Y. <[EMAIL PROTECTED]> wrote: > -邮件原件- > 发件人: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] 代表 Gabriel > Genellina > 发送时间: 2008年4月14日 12:59 > 收件人: python-list@python.org > 主题: Re: how to remove \n in the list

Re: 答复: how to remove \n in the list

2008-04-14 Thread Gabriel Genellina
En Mon, 14 Apr 2008 04:08:06 -0300, Penny Y. <[EMAIL PROTECTED]> escribió: >> lines[:] = [line.rstrip('\n') for line in lines] > > why not just: > > lines = [line.rstrip('\n') for line in lines] > > > what's the difference between lines[:] and lines here? Thanks. My version (using [:]) replaces t

答复: how to remove \n in the list

2008-04-14 Thread Penny Y.
> lines[:] = [line.rstrip('\n') for line in lines] why not just: lines = [line.rstrip('\n') for line in lines] what's the difference between lines[:] and lines here? Thanks. -邮件原件- 发件人: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 代表 Gabriel Genellina 发送时间: 2008年4月14日 12:59 收件人: python-