I'd like to be able to overwrite some bytes at a given offset in a file using Python.
My attempts have failed miserably and resulted in:
- overwriting the bytes at the offset but also truncating the file just after (file mode = "w" or "w+")
- appending the bytes at the end of the file (file mode = "a" or "a+")
Is it possible to achieve this with Python in a portable way?