Use '\n'.join(handle[1:])
It will create a string from your list with newline as separator.
Alan Gauld
Author of the Learn To Program website
http://www.alan-g.me.uk/
________________________________
From: Bala subramanian <bala.biophys...@gmail.com>
To: Alan Gauld <alan.ga...@btinternet.com>
Sent: Thursday, 26 March, 2009 6:11:59 PM
Subject: Re: [Tutor] printing files
yes you are right,
When i use the following
print>>out, handle[1:]
In the out file, it saves the lines as a list rather than as a string. How to
avoid this.
Bala
On Thu, Mar 26, 2009 at 7:05 PM, Alan Gauld <alan.ga...@btinternet.com> wrote:
"Bala subramanian" <bala.biophys...@gmail.com> wrote
for files in flist:
handle=open(flist).readlines()
print>>out, handle
print>>out, handle[1:]
Should do it? You might need to handle line endings though...
Alan G.
_______________________________________________
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
_______________________________________________
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor