[Twisted-Python] Big/Little-endian problem

Xian Chen hoganxian at gmail.com
Tue Apr 22 19:57:17 EDT 2008


Thanks~~

On Wed, Apr 23, 2008 at 7:41 AM, Christopher Armstrong <
radix at twistedmatrix.com> wrote:

> 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,
> http://docs.python.org/lib/module-struct.html
>
> --
> Christopher Armstrong
> International Man of Twistery
> http://radix.twistedmatrix.com/
> http://twistedmatrix.com/
> http://canonical.com/
>
> _______________________________________________
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://twistedmatrix.com/pipermail/twisted-python/attachments/20080423/9ff78d04/attachment.htm 


More information about the Twisted-Python mailing list