Bit Operations

Chris Mellon arkanes at gmail.com
Wed Nov 28 16:23:41 EST 2007


On Nov 28, 2007 3:18 PM, J. Clifford Dyer <jcd at sdf.lonestar.org> wrote:
> On Wed, Nov 28, 2007 at 10:05:40PM +0100, Gianmaria Iaculo - NVENTA wrote regarding Re: Bit Operations:
> >
> > Txs all,
> > i wont to respond to who asked why i needed it:
> >
> > I'm using python on GSM modules and the informations i have to move goes
> > along GPRS/UMTS connections so it's beatiful for me to transfer more
> > informations with less space...
> > imagine i have to send this simple data....
> >
> > 41.232323,12.345678
> >
> > i can send it as it's or use the nibble trick and on the receiving station
> > 'unlift" the data and rebuild the original information...
> >
> > isn'it???
> >
>
> Um, no.  It isn't.  How exactly are you going to pack floating point numbers into a half a byte?
>
> Or are you sending it as strings?  Also a waste of space, and unnecessarily complex.
>

Assuming these are coordinates, not floats, using strings makes sense
but the zlib module is probably a much better choice than a
hand-written compression scheme.



More information about the Python-list mailing list