files: direct access - NOT sequential

Terry Reedy tjreedy at udel.edu
Tue Apr 15 08:13:54 EDT 2003


"Patrick Carabin" <Patrick.Carabin at sciencesnaturelles.be> wrote in
message news:mailman.1050398560.8881.python-list at python.org...
i search a means to get " direct access " inside files, eg mixing
read & write operaions for the same file
example:
given a file with contents : "qwerty" , positionning on the "w", and
writing a "N" , so the file becomes "qNerty"
How can i achieve this in Python ?
----------
open in 'w' mode or (probably better for Windows,  'wb') mode and use
tell() and seek() methods.  tjr






More information about the Python-list mailing list