Rosario Morgan wrote:
> Hello
>
> Help is great appreciated in advance.
>
> I need to loop through a file 6000 bytes at a time. I was going to
> use the following but do not know how to advance through the file 6000
> bytes at a time.
>
> file = open('hotels.xml')
while True:
block = file.
Rune Strand wrote:
> Probably a more terse way to do this, but this seems to work
> import os
>
> offset = 0
> grab_size = 6000
> file_size = os.stat('hotels.xml')[6]
ouch. why not just loop until f.read returns an empty string ?
> f = open('hotels.xml', 'r')
>
> while offset < file_size:
>
Rosario Morgan wrote:
> Hello
>
> Help is great appreciated in advance.
>
> I need to loop through a file 6000 bytes at a time. I was going to
> use the following but do not know how to advance through the file 6000
> bytes at a time.
>
> file = open('hotels.xml')
> block = file.read(6000)
> newb
Hello
Help is great appreciated in advance.
I need to loop through a file 6000 bytes at a time. I was going to
use the following but do not know how to advance through the file 6000
bytes at a time.
file = open('hotels.xml')
block = file.read(6000)