Re: [Tutor] re.format a file

2009-02-26 Thread Martin Walsh
A.T.Hofkamp wrote: > prasad rao wrote: >> helloThank you Lie and Kent. >> I forgot about newline character and the fact that string can be sliced. >> Thanks for your timely help >> BTW I have gone through the Python library reference and find no >> examples >> in fileinput module. > > The filein

Re: [Tutor] re.format a file

2009-02-26 Thread Kent Johnson
On Thu, Feb 26, 2009 at 8:43 AM, prasad rao wrote: > hello > Thank you Lie and Kent. > I forgot  about newline character and the fact that string can be sliced. > Thanks for your timely help > BTW I have gone through  the Python library reference and find no examples > in fileinput module. > z=fil

Re: [Tutor] re.format a file

2009-02-26 Thread A.T.Hofkamp
prasad rao wrote: helloThank you Lie and Kent. I forgot about newline character and the fact that string can be sliced. Thanks for your timely help BTW I have gone through the Python library reference and find no examples in fileinput module. The fileinput module only deals with reading and w

[Tutor] re.format a file

2009-02-26 Thread prasad rao
helloThank you Lie and Kent. I forgot about newline character and the fact that string can be sliced. Thanks for your timely help BTW I have gone through the Python library reference and find no examples in fileinput module. z=fileinput.input(file,inplace=1) for line in z: ???if len(line)<60:pa