Re: [Tutor] printing files

2009-03-26 Thread Alan Gauld
"Kent Johnson" wrote On Thu, Mar 26, 2009 at 2:58 PM, ALAN GAULD wrote: Use '\n'.join(handle[1:]) It will create a string from your list with newline as separator. The lines from readlines() include the newlines already. Ah, OK, I couldn't remember if readlines stripped them off or not.

Re: [Tutor] printing files

2009-03-26 Thread Kent Johnson
On Thu, Mar 26, 2009 at 2:58 PM, ALAN GAULD wrote: > Use '\n'.join(handle[1:]) > It will create a string from your list with newline as separator. The lines from readlines() include the newlines already. > When i use the following > > print>>out, handle[1:] > > In the out file, it saves the line

Re: [Tutor] printing files

2009-03-26 Thread ALAN GAULD
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 wrote: "Bala subramanian"

Re: [Tutor] printing files

2009-03-26 Thread Alan Gauld
"Bala subramanian" 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:/

Re: [Tutor] printing files

2009-03-26 Thread Marc Tompkins
On Thu, Mar 26, 2009 at 10:56 AM, Marc Tompkins wrote: > Without changing anything else, you could do it with a slice: > You should probably also close your input files when you're done with them. -- www.fsrtechnologies.com ___ Tutor maillist - Tuto

Re: [Tutor] printing files

2009-03-26 Thread Marc Tompkins
On Thu, Mar 26, 2009 at 10:42 AM, Bala subramanian < bala.biophys...@gmail.com> wrote: >print>>out, handle <-- Here i want to write only from second line. I > dnt want to loop over handle here and putting all lines except the first one > in > anothe

[Tutor] printing files

2009-03-26 Thread Bala subramanian
Friends, My files are like below file1 file2 RemarkRemark --- --- I have huge number of such files. I want to concatenate all files in one huge file. I could do it with a script. But i want to omit the first l