[Tutor] Fwd: how to see a number as two bytes

Luke Paireepinart rabidpoobear at gmail.com
Mon Oct 20 18:00:36 CEST 2008


---------- Forwarded message ----------
From: Luke Paireepinart <rabidpoobear at gmail.com>
Date: Mon, Oct 20, 2008 at 11:00 AM
Subject: Re: [Tutor] how to see a number as two bytes
To: shawn bright <nephish at gmail.com>


high, low = ((num % 2**16) >> 8, num % 2**8)  or something thereabouts.

On Mon, Oct 20, 2008 at 10:47 AM, shawn bright <nephish at gmail.com> wrote:
> hey there all,
> i have a script that needs to send a number as two bytes.
> how would i be able to see a number expressed as a hi byte and a lo byte?
>
> thanks
> shawn
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor
>


More information about the Tutor mailing list