I have the following:
with open(file, 'a') as log:
#A bunch of code, some of it writes to log.
log.seek(0)
log.write(time.strftime(t_format))
seek() doesn't work with append, and if I use 'w', then the beginning of the file gets overwritten. In the docs it says, "...'a' for appending (which on some Unix systems means that all writes append to the end of the file regardless of the current seek position)"
Is there any way to override this?