FAQ
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

Search Discussions

  • John La Rooy at Jul 2, 2002 at 12:18 am

    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
  • Larry at Jul 2, 2002 at 12:41 am
    "John La Rooy" <larooy at xtar.co.nz> wrote in message
    news:20020702121832.51ed39eb.larooy at xtar.co.nz...
    On Tue, 02 Jul 2002 00:11:17 GMT
    "news" <ld @ nospam.com> wrote:
    perhaps the file has the windows EOF character in it? ctrl-D or ctrl-Z i think.
    try

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

    That did the trick!!! Thank you so much!!!

    Larry

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppython-list @
categoriespython
postedJul 2, '02 at 12:11a
activeJul 2, '02 at 12:41a
posts3
users2
websitepython.org

2 users in discussion

Larry: 2 posts John La Rooy: 1 post

People

Translate

site design / logo © 2022 Grokbase