File object question
Tim Williams (gmail)
tdwdotnet at gmail.com
Fri Dec 23 00:30:51 CET 2005
On 22/12/05, S. D. Rose <s_david_rose at hotmail.com> wrote:
> Hello all.
> If I read a binary file:
> file = open('c:\\logo.gif', 'rw'') # Read from FS as one way to get the
> object, d/l from website another...
> is there anyway I can determine the 'size' of the object file? (Without
> going to the filesystem and reading the filesize from the directory ...
On my w2k box I use this for binary files
file = open('c:\\logo.gif', 'r+b'') # Read from FS as one way to get the
object, d/l from website another...
file_read = file.read()
Note: you must specify the binary option for binary files or you may not
get the whole file.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-list