Diarmuid Bourke 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.
could you operate in 32 bits internally and convert to/from 16 bit using the struct module or something? Pádraig. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
