In article <[email protected]>,
Lawrence D'Oliveiro  <[email protected]_zealand> wrote:
>
>This routine is so useful, I wonder there's nothing like it in module
>struct, or anywhere else I'm aware of:
>
>    def structread(fromfile, decode_struct) :
>        """reads sufficient bytes from fromfile to be unpacked according to
>        decode_struct, and returns the unpacked results."""                
>        return struct.unpack(decode_struct, 
> fromfile.read(struct.calcsize(decode_struct)))
>    #end structread

Guido is generally opposed to simple one-liners.
-- 
Aahz ([email protected])           <*>         http://www.pythoncraft.com/

Member of the Groucho Marx Fan Club  
-- 
http://mail.python.org/mailman/listinfo/python-list
  • structread Lawrence D'Oliveiro
    • Re: structread Aahz

Reply via email to