Re: unpack('>f', b'\x00\x01\x00\x00')

2011-12-02 Thread Mark Dickinson
On Dec 1, 10:21 am, Hrvoje Niksic wrote: > Chris Rebert writes: > > C does not have a built-in fixed-point datatype, so the `struct` > > module doesn't handle fixed-point numbers directly. > > The built-in decimal module supports fixed-point arithmetic, but the > struct module doesn't know about

Re: unpack('>f', b'\x00\x01\x00\x00')

2011-12-01 Thread Hrvoje Niksic
Chris Rebert writes: > C does not have a built-in fixed-point datatype, so the `struct` > module doesn't handle fixed-point numbers directly. The built-in decimal module supports fixed-point arithmetic, but the struct module doesn't know about it. A bug report (or patch) by someone who works wi

Re: unpack('>f', b'\x00\x01\x00\x00')

2011-11-30 Thread Ian Kelly
On Wed, Nov 30, 2011 at 3:24 PM, kuaile xu wrote: > Hi: > > I am working on a python script that parses mp4 video header. Once of > the field is a 32-bit fixed-point number. > > I know that the four bytes are: 00, 01, 00, 00. I have a third party > mp4 parsing program which displays this field's v

Re: unpack('>f', b'\x00\x01\x00\x00')

2011-11-30 Thread kuaile xu
On Nov 30, 6:02 pm, Chris Rebert wrote: > On Wed, Nov 30, 2011 at 2:24 PM, kuaile xu wrote: > > Hi: > > > I am working on a python script that parses mp4 video header. Once of > > the field is a 32-bit fixed-point number. > > > I know that the four bytes are: 00, 01, 00, 00. I have a third party

Re: unpack('>f', b'\x00\x01\x00\x00')

2011-11-30 Thread Chris Rebert
On Wed, Nov 30, 2011 at 2:24 PM, kuaile xu wrote: > Hi: > > I am working on a python script that parses mp4 video header. Once of > the field is a 32-bit fixed-point number. > > I know that the four bytes are: 00, 01, 00, 00. I have a third party > mp4 parsing program which displays this field's v

Re: Unpack Expects the Wrong Number of Bytes

2009-07-18 Thread Ross Ridge
Timothy Crone wrote: >header = "s" >data = list(unpack(header,f.read(1))) > >however this: > >header = "si" >data = list(unpack(header,f.read(5))) > >throws > >struct.error: unpack requires a string argument of length 8 > >So unpack expects 7 additional bytes when an integer is added to the >form

Re: Unpack Expects the Wrong Number of Bytes

2009-07-18 Thread John Machin
On Jul 19, 12:34 am, Timothy Crone wrote: > Hello, > > I have noticed that for certain format strings, struct.unpack expects > the wrong number of bytes. [snip] > header = "si" > data = list(unpack(header,f.read(5))) > > throws > > struct.error: unpack requires a string argument of length 8 > > So

Re: Unpack less values from function's return values

2009-05-29 Thread MRAB
Chris Rebert wrote: On Thu, May 28, 2009 at 3:19 AM, wrote: Hi, I'm using Python 2.5.2. I'm getting this error whenever I try to unpack less values from a function. ValueError: too many values to unpack I want to know if there is a way I can unpack less values returning from a function?

Re: Unpack less values from function's return values

2009-05-28 Thread Bobby
On May 28, 5:40 am, Chris Rebert wrote: > On Thu, May 28, 2009 at 3:19 AM,   wrote: > > Hi, > > > I'm using Python 2.5.2. I'm getting this error whenever I try to unpack less > > values from a function. > > > ValueError: too many values to unpack > > > I want to know if there is a way I can unpack

Re: Unpack less values from function's return values

2009-05-28 Thread Chris Rebert
On Thu, May 28, 2009 at 3:19 AM, wrote: > Hi, > > I'm using Python 2.5.2. I'm getting this error whenever I try to unpack less > values from a function. > > ValueError: too many values to unpack > > > I want to know if there is a way I can unpack less values returning from a > function? Unpack t

Re: unpack the source tarball on Windows

2009-03-31 Thread Michael Torrie
Mensanator wrote: > Thanks. Still had to untar the ball, but I also downloaded a > trial version of Winzip which took care of that. Right. The proper command is: tar -xvjf tarball.tar.bz2 The recommended GUI for all things archival on Windows I think has to be 7zip. And it's not cursed sharewa

Re: unpack the source tarball on Windows

2009-03-30 Thread alex23
On Mar 31, 2:25 pm, Mensanator wrote: > Thanks, I'll try that next time (when the Winzip 45 day > trial expires). Better still, grab the freec 7-Zip: http://www.7-zip.org/ Supported formats: * Packing / unpacking: 7z, ZIP, GZIP, BZIP2 and TAR * Unpacking only: ARJ, CAB, CHM, CPIO, DEB,

Re: unpack the source tarball on Windows

2009-03-30 Thread Mensanator
On Mar 30, 8:49�pm, "drobi...@gmail.com" wrote: > On Mar 30, 7:10�pm, Mensanator wrote: > > > I'm looking for the Turtle Graphics Demos (apparently not included in > > the Windows install). > > > So I downloaded the bzipped source tarball. > > > I've got Cygwin installed and assume it has the nee

Re: unpack the source tarball on Windows

2009-03-30 Thread drobi...@gmail.com
On Mar 30, 7:10 pm, Mensanator wrote: > I'm looking for the Turtle Graphics Demos (apparently not included in > the Windows install). > > So I downloaded the bzipped source tarball. > > I've got Cygwin installed and assume it has the needed utilities. > > What would I type at the Cygwin prompt to

Re: unpack the source tarball on Windows

2009-03-30 Thread Mensanator
On Mar 30, 6:34 pm, "Gabriel Genellina" wrote: > En Mon, 30 Mar 2009 20:10:28 -0300, Mensanator   > escribió: > > > I'm looking for the Turtle Graphics Demos (apparently not included in > > the Windows install). > > > So I downloaded the bzipped source tarball. > > > I've got Cygwin installed and

Re: unpack the source tarball on Windows

2009-03-30 Thread Gabriel Genellina
En Mon, 30 Mar 2009 20:10:28 -0300, Mensanator escribió: I'm looking for the Turtle Graphics Demos (apparently not included in the Windows install). So I downloaded the bzipped source tarball. I've got Cygwin installed and assume it has the needed utilities. What would I type at the Cygwin

RE: unpack

2008-04-11 Thread ha bo
thank you i did find solution i did have just change: unpackedData = struct.unpack(unpackFormat, data) to unpackedData = struct.unpack(unpackFormat, data.decode('string_escape')) From: [EMAIL PROTECTED] Subject: Python-list Digest, Vol 55, Issue 179 To: python-list@python.org Date