[Twisted-Python] Big/Little-endian problem

Christopher Armstrong radix at twistedmatrix.com
Tue Apr 22 19:41:08 EDT 2008

On Tue, Apr 22, 2008 at 7:32 PM, Xian Chen <hoganxian at gmail.com> wrote:
> In Twisted, do the user need to take care of the big/little-endian issues?

The basic Twisted protocol system is purely in terms of bytes,
represented by the Python 'str' type.

> For example, I receive a buffer via UDP which actually represents a unsinged
> int value. So, how can i convert this buffer[0:1] to unsigned int ?

Check out the 'struct' Python module,

Christopher Armstrong
International Man of Twistery

More information about the Twisted-Python mailing list