hello I find it difficult to use horizontal scroll bar to read text documents. So I want to split lines in the text file in to two lines.
<code> def myforrmat(source,desty): ???? so=open(source) ???? de=open(desty,'w') ???? for line in so: ????????? if len(line)<60:de.write(line) ????????? if len(line)>60: ????????????de.write(''.join(list(line)[:60])) ????????????de.write(''.join(list(line)[60:])) ????so.close() ????de.close() </code> This code is not working.Destination file have the same length of lines to source file Some one please show where the problem is. I tried to do it using fileinput module and inplace flag. in vain. please some one show me how to do it. Thank you Prasad
_______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor