[Tutor] re Format a file

prasad rao prasadaraon50 at gmail.com
Sat Feb 28 13:40:29 CET 2009


Hello


>> ???? for line in so:
>> ???????? if len(line)<70:de.write(line+'\n')
>> ????????  if len(line)>70:
>> ???????????? da=textwrap.fill(line,width=60)
>> ???????????? de.write(da+'\n')

>What happens if the line is exactly 70 characters long?
>I think you want an else instead of the second if....

>Alan G
>Author of the Learn to Program web site


True.Thanks  for pointing out  the folly.
I might have lost bits of data.

Thank you
Prasad
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20090228/af9b0f6e/attachment.htm>


More information about the Tutor mailing list