Your problem is on this line:

fobj.write('\n'.join(all))

This puts a newline in between each line in "all", but not at the end.
The fix is simple:

fobj.write('\n'.join(all) + '\n')

This will make sure that the last line has a newline at the end of it,
so that when you later append data, it will appear on a fresh line.

-Al Sweigart
You should check out my free beginner's Python book, "Invent Your Own
Computer Games with Python"
http://inventwithpython.com
_______________________________________________
Tutor maillist  -  [email protected]
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to