Books Database

Eliran Gonen eg at rootshell.be
Fri Mar 7 08:16:28 EST 2003


Alex Martelli <aleaxit at yahoo.com>: 
> >   books = file('books.dat').readlines()
>     del books[3]
> >   file('books.dat', 'w').writelines(books)
> >
> > But the point is that you process everything in memory and then
> > overwrite the file when done rather that trying to manipulate
> > the individual lines of the file directly.

Would that be more efficient (keep everything in an inside
variable/list/whatever instead of reading the file again
and again) ?





More information about the Python-list mailing list