On Fri, 27 Feb 2009 09:59:40 +0530, prasad rao wrote: > def myform(s): > import os > so=open(s) > d=os.path.dirname(s)+os.sep+'temp.txt' > de=open(d,'w') > for line in so: > while len(line)>60: > item=line[60:] > try: > a,b=tem.split(' ',1)
what is tem here? It must be a global, since I can't see any other reference to tem in the function definition. If tem is global, then the value of b (a.k.a. line) will never change (except for the first iteration) > de.write(line[:60]+a+'\n') > line=b > except ValueError: > pass > de.write(line+'\n') > so.close() > de.close() > os.remove(s) > os.rename(d,s) _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor