Re: Want to build a binary header block

2007-05-02 Thread Nick Craig-Wood
Bob Greschke <[EMAIL PROTECTED]> wrote: > This is the idea > > Block = pack("240s", "") > Block[0:4] = pack(">H", W) > Block[4:8] = pack(">H", X) > Block[8:12] = pack(">B", Y) > Block[12:16] = pack(">H", Z)) > > but, of course, Block, a str, can't be sliced. You could do th

Re: Want to build a binary header block

2007-05-01 Thread Larry Bates
Bob Greschke wrote: > This is the idea > >Block = pack("240s", "") >Block[0:4] = pack(">H", W) >Block[4:8] = pack(">H", X) >Block[8:12] = pack(">B", Y) >Block[12:16] = pack(">H", Z)) > > but, of course, Block, a str, can't be sliced. The real use of this is a > bit more comp

Want to build a binary header block

2007-04-30 Thread Bob Greschke
This is the idea Block = pack("240s", "") Block[0:4] = pack(">H", W) Block[4:8] = pack(">H", X) Block[8:12] = pack(">B", Y) Block[12:16] = pack(">H", Z)) but, of course, Block, a str, can't be sliced. The real use of this is a bit more complicated such that I can't just fill in a