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:
Is it possible to achieve this with Python in a portable way?
Try this:
fh = open("filename.ext", "r+b")
fh.seek(offset)
fh.write(bytes)
fh.close()