"Thierry Lam" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Is there an easy way to write something of variable length at the top
> of the file?
...
> The other way to do what I want is to write the whole thing to a new
> file, but I want to skip that method if there's an alternat
On 14 Sep 2005 07:13:50 -0700, "Thierry Lam" <[EMAIL PROTECTED]> wrote:
>Let's say I already wrote a file and have the following:
>
>testing
>testing testing
>testing testing testing
>
>Is there an easy way to write something of variable length at the top
>of the file?
>
>For example,
>
>6 testing
On 2005-09-14, Thierry Lam <[EMAIL PROTECTED]> wrote:
> Let's say I already wrote a file and have the following:
>
> testing
> testing testing
> testing testing testing
>
> Is there an easy way to write something of variable length at the top
> of the file?
No.
[...]
> The other way to do what I
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
--
http://mail.python.org/mailman/listinfo/python-list
Let's say I already wrote a file and have the following:
testing
testing testing
testing testing testing
Is there an easy way to write something of variable length at the top
of the file?
For example,
6 testing written
testing
testing testing
testing testing testing
I tried to write some garba