File read problem in Windows

John La Rooy larooy at xtar.co.nz
Mon Jul 1 20:18:32 EDT 2002


On Tue, 02 Jul 2002 00:11:17 GMT
"news" <ld @ nospam.com> wrote:

> f = open('myfile,'r')
> a = f.read(3072)
> 
> When I do a len(a) I only get 634 bytes.  It doesn't seem to want to grab
> the full 3072.  This ONLY happens in windows...when I run my program in
> Linux I get the full 3072 and everything works fine!
> 
> Any ideas?
> 
> Thnx...Larry
> 
> 
perhaps the file has the windows EOF character in it? ctrl-D or ctrl-Z i think.
try 

f=open('myfile','rb')

John



More information about the Python-list mailing list