<snip> >> >> def translate_process(dictionary,tobetranslatedfile): >> results=[] >> unique={} >> for line in open(tobetranslatedfile,"r"): >> tobetranslatedparts=line.strip().split() >> results.append(dictionary[tobetranslatedparts[2]]) >> unique=Counter(results) >> with open(base+OUTPUTFILEEXT,"w") as f: > > Every time you do this, you're truncating the file. It'd be better to open > the file outside the for-line loop, and just use the file object in the > loop.
Before I did not understand well, until I read Peter's following post. Thanks, <snip> > > -- > > DaveA > > _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor