Python thinks file is empty

Tim Roberts timr at
Tue Nov 6 06:32:00 CET 2007

loial <jldunn2000 at> wrote:
>I am writing a file in python with writelines
>f = open('/home/john/myfile',"w")

Are you absolutely sure it looks like that?  If you wrote this:


(as reformed VB programmers tend to write) it would run without error or
warning, but the file would not actually be closed.  The data would be hung
up the buffer, and the file would be 0 length.
Tim Roberts, timr at
Providenza & Boekelheide, Inc.

More information about the Python-list mailing list