On Thu, Apr 24, 2008 at 2:34 PM, Diarmuid Bourke <[EMAIL PROTECTED]> wrote: > > Hey all, > I'm new to python, but I'm finding it really cool and nice. > My questions is how would I limit a integer to 16bits, as I'm making a LZW > implementation for college and I want to constrain the codewords to 16bits > instead of pythons default 32. > > Basically I want to end up with the encoded file containing only 2byte > integer codewords. > I havent seen any way of doing this in the docs yet, perhaps someone here > will know.
>>> from numpy import int16 :) -- Pablo Martí http://www.linkedin.com/in/pmarti || http://www.warp.es python -c "print '706d6172746940776172702e6573'.decode('hex')" --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Python Ireland" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.ie/group/pythonireland?hl=en -~----------~----~----~----~------~----~------~--~---
