Re: Reading binary from a file...

2006-03-08 Thread Bryan Olson
KraftDiner wrote: [...] > In python I'm able to read in binary data from a file. [...] > > However the data is 16bits per sample and python is storing the > data in a string. How do I convert that 8bit data into a list of 16 > bit integers? On the vast majority of systems, files hold sequences o

Re: Reading binary from a file...

2006-03-08 Thread Laurent Pointal
Steve Holden a écrit : > KraftDiner wrote: >> Hi! >> In python I'm able to read in binary data from a file. >> data = file.read() # Reads in an entire file. >> > Note that you should open the file in binary mode to be > platform-agnostic and as portable as possible. (Just in case you aren't). > >

Re: Reading binary from a file...

2006-03-07 Thread Steve Holden
KraftDiner wrote: > Hi! > In python I'm able to read in binary data from a file. > data = file.read() # Reads in an entire file. > Note that you should open the file in binary mode to be platform-agnostic and as portable as possible. (Just in case you aren't). > However the data is 16bits per s

Reading binary from a file...

2006-03-07 Thread KraftDiner
Hi! In python I'm able to read in binary data from a file. data = file.read() # Reads in an entire file. However the data is 16bits per sample and python is storing the data in a string. How do I convert that 8bit data into a list of 16 bit integers? Note: I want generic python lists or tupels