file processing question
kahanpaa at gstar.astro.helsinki.fi
Mon Sep 2 13:05:33 CEST 2002
Axel Grune <NineOfSix at gmx.de> wrote:
> Hi, Im trying to read the data of a file with following method
> file = open( inputfile, "r")
> data = file.read()
> but 'data' is always smaller then the file size, e.g. I have a file
> which is 25677824 bytes but file.read() reads only 4295 (file.tell() =
> Im using python 2.2 under win2k.
Is your data binary or plaintext? Have you tried reading in binary mode?
file = open(inputfilename,"rb")
data = file.read()
It's hard to think outside the box when you ARE the box.
- unknown, alt.religion.kibology
More information about the Python-list