HelloFinally I managed to writ a function to format a file. Thank to everybody for their tips.
def mmm(a): ???? import os,textwrap ???? so=open(a) ???? d=os.path.dirname(a)+os.sep+'temp.txt' ???? de=open(d,'w') ???? import textwrap ???? 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') ???? so.close() ???? de.close() Any improvements and suggestions are welcome. Thanks Prasad
_______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor