Random Access Files

Fredrik Lundh fredrik at pythonware.com
Thu Mar 15 12:45:22 EST 2001


Colin Meeks wrote:
> I would like to be able to do something like
>
>     1.    Seek the potion to write

f.seek(offset)

>     2.    Write

f.write(data)

>     3.    Close file

f.close()

> I don't mean writing code that hides the methods of the first example.  If I
> remember correctly you can do random access files in GWBasic.
>
> Anyone have any pointer??

http://www.python.org/doc/current/lib/bltin-file-objects.html

Cheers /F

<!-- (the eff-bot guide to) the standard python library:
http://www.pythonware.com/people/fredrik/librarybook.htm
-->





More information about the Python-list mailing list