Re: Question about struct.unpack

2006-02-22 Thread Scott David Daniels
Eric Jacoboni wrote: > But : >> nom = nomz.rstrip('\0') > > doesn't work for me: > nomz > 'Dupont\x00\x80\xbf\xff\xf70\x8f\xe0u\xa4\x00\x00.8\xfe\xfe\xfe\xff\x80\x80\x80\x80' > nom = nomz.rstrip('\0') nom > 'Dupont\x00\x80\xbf\xff\xf70\x8f\xe0u\xa4\x00\x00.8\xfe\xfe\xfe\xff\x8

Re: Question about struct.unpack

2006-02-22 Thread Eric Jacoboni
Scott David Daniels <[EMAIL PROTECTED]> writes: Thanks for your explanations. But : > nom = nomz.rstrip('\0') doesn't work for me: >>> nomz 'Dupont\x00\x80\xbf\xff\xf70\x8f\xe0u\xa4\x00\x00.8\xfe\xfe\xfe\xff\x80\x80\x80\x80' >>> nom = nomz.rstrip('\0') >>> nom 'Dupont\x00\x80\xbf\xff\xf70\

Re: Question about struct.unpack

2006-02-22 Thread Scott David Daniels
Eric Jacoboni wrote: > Hi, > > To experiment with unpacking, i've written a little C code which > stores one record in a file. Then, i try to reread this file to unpack > the record. > > Here's the struct of a record: > > typedef struct { > char nom[30]; > double taille; > int

Question about struct.unpack

2006-02-22 Thread Eric Jacoboni
Hi, To experiment with unpacking, i've written a little C code which stores one record in a file. Then, i try to reread this file to unpack the record. Here's the struct of a record: typedef struct { char nom[30]; double taille; int age; char plop; } enreg_t; The whole