> this code python interprets as:
>
> data = myfile.read(10)
> for chunk in data:
> .
>
Aha - now that you put it that way it makes sense. And thanks to all
who replied - I'll try out the other suggestions too.
Mark
--
http://mail.python.org/mailman/listinfo/python-list
Mark wrote:
Thanks I tested your solution and that works.
One of the things that didn't work was
for chunk in myfile.read(10):
info1, info2, info3 = struct.unpack('
this code python interprets as:
data = myfile.read(10)
for chunk in data:
.
--Scott David Daniels
[EMAIL PR
Thanks I tested your solution and that works.
One of the things that didn't work was
for chunk in myfile.read(10):
info1, info2, info3 = struct.unpack('http://mail.python.org/mailman/listinfo/python-list
Mark wrote:
Hi;
I'm trying to use the struct.unpack to extract an int, int, char
struct info from a file. I'm more accustomed to the file.readlines
which works well in a 'for' construct (ending loop after reaching
EOF).
You do not need .readlines to iterate through a file by lines.
for line
En Mon, 27 Oct 2008 19:03:37 -0200, Steven Clark
<[EMAIL PROTECTED]> escribió:
On Mon, Oct 27, 2008 at 4:29 PM, Mark <[EMAIL PROTECTED]> wrote:
Hi;
I'm trying to use the struct.unpack to extract an int, int, char
struct info from a file. I'm more accustomed to the file.readlines
which works
On Mon, Oct 27, 2008 at 4:29 PM, Mark <[EMAIL PROTECTED]> wrote:
> Hi;
>
> I'm trying to use the struct.unpack to extract an int, int, char
> struct info from a file. I'm more accustomed to the file.readlines
> which works well in a 'for' construct (ending loop after reaching
> EOF).
>
> # This do
Hi;
I'm trying to use the struct.unpack to extract an int, int, char
struct info from a file. I'm more accustomed to the file.readlines
which works well in a 'for' construct (ending loop after reaching
EOF).
# This does OK at fetching one 10-byte string at a time:
# (4, 4, 2 ascii chars represen