"Sai Krishna M" wrote:

> One crude idea i had was to read the file in a list and insert the
> string correspondingly.

file systems usually don't support insertion and deletion, so if you want to 
move
things around, you have to do that yourself.

reading and writing lists (using readlines/writelines) works well, as long as 
the files
aren't too large.

> Is there any other way to do this?

not with plain files.  if you need to do lots of inserts/deletes, you should 
probably
use a database manager instead (which uses more elaborate data structures on
disk).  see e.g. the "dbm" and "bsddb" modules in the standard library.

</F> 



-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to