When running the following python code:
>>> f = open(r\"myfile.txt\", \"a+\")
>>> f.seek(-1,2)
Works for me:
$ echo hello > myfile.txt
$ python
Python 2.5.2 (r252:60911, Oct 5 2008, 19:24:49)
[GCC 4.3.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> f = open('myfile.txt', 'r+')
>>> f.seek(-1, 2)
>>> f.tell()
5L
>>> f.read()
'\n'
>>> f.write('\n')
>>> f.close()
Are you on windows? If so, try 'rb+' instead of 'r+' in the mode.