reading binary data

Alex Martelli aleaxit at yahoo.com
Wed Mar 14 18:23:58 EST 2001


"Francois Forest" <francois_forest at yahoo.fr> wrote in message
news:3AAFE69D.FF01FEC8 at yahoo.fr...
> I would like to read and write xxx.wav files,
> this assume to alternatively read characters,  integers 16 bits and
> integers 32 bits.
> I found that I can read a binary file and get the result in a string,
> Is there a way to convert a string slice into an int16, int32, or
> floatting point ?
> (what is usually done in C through a cast).

The struct module offers exactly this facility.


> More generally, how can I browse through standard libraries ?

By reading the excellent library manual that comes with
Python and/or the well-commented sources.  Maybe I'm
missing something in your question...?


Alex






More information about the Python-list mailing list