> Everything Dave Angel said applies. > > You can sort the keys by doing and sorting the keys and then logging. > That should ensure field order. > > for k in sorted(self.fields): > v = self.fields[k] > > > Also note, that unless you do self.logfile.close() it is not guaranteed > that the data is being written to file. I prefer to use the following > idiom for Python 2.6+ (might be in 2.5, but not sure offhand when it was > added). > > with open('filename.txt', 'a') as f: > # write data > > Thanks! Now with some experience using this logger i have found that the items, while they may not be in an ideal order, are nonetheless always in the same order starting with date/time. In the interest of getting this thing working ASAP the current ordering is acceptable for now; at some later time I may try to arrange into some other desired order.
I am testing the 'a' append mode now. hoping this will allow for not overwriting existing data. Where in the program do I put the: self.logfile.close() Is there someway to trigger this from the UI? or even when the program is stopped? _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor