On Tue, 18 Jan 2005 22:53:10 -0800, Eric Pederson <[EMAIL PROTECTED]> wrote: > > I didn't come across any illuminating discussion via Google, thus my question > here (though it may be a neophyte question.) I am interested in the workings > under the hood of Python's access of "files". > > What is actually happening at the various stages when I create a file object > and "read" it? > > (1) >>> f = file("C:/GuidosParrot.txt","r") You've just opened a file for reading. You haven't read any data, but at this point if the file wasn't there, the OS would have throw you an error.
> (2) >>> hesjustsleeping = f.read() The entire file is read directly into a single python str. Regards, Stephen Thorne. -- http://mail.python.org/mailman/listinfo/python-list