Is this the efficent way?

Arinté n at n.com
Fri Jul 28 12:10:15 EDT 2000


> I think this is better:
>
> def hexsplit(arg):
>         lobyte =  arg & 0x00FF
>         hibyte = (arg & 0xFF00) >> 8
>         return chr(hibyte) + chr(lobyte)
>
>
> Carsten.

Sure is, didn't know python had shift operators.





More information about the Python-list mailing list