Writing at the beginning of a file

Paul McGuire ptmcg at austin.rr.com
Wed Sep 14 10:43:21 EDT 2005


Thierry -

Check out the StringIO module.  It will allow you to buffer the whole
file into a string, and then give you a pseudo file pointer to the
string buffer, so that your "fp.write"s will work unchanged.

-- Paul




More information about the Python-list mailing list