the
macroscopic! This way the code is readable by anyone (including you!)
and you are free to dream up any algorithms you like.
--
Mark Warburton
Ottawa, Canada
--
http://mail.python.org/mailman/listinfo/python-list
You want something like this:
>>> a = '\x1dz'
>>> (ord(a[0])<<8) + ord(a[1])
7546
Each of the two characters represents one byte of a 16-bit integer. It
doesn't matter if they are ascii or hex -- there are still exactly two
bytes in each of your strings.
The ord() function converts a character
Peter Otten wrote:
> To convert them you need struct.unpack()
Ahh, right. Batteries included! Thanks for the enlightenment. :)
--
http://mail.python.org/mailman/listinfo/python-list
Grant Edwards wrote:
> On 2006-03-22, Mark Warburton <[EMAIL PROTECTED]> wrote:
> > Ahh, right. Batteries included! Thanks for the enlightenment. :)
>
> I think that's the third time _today_ that question has been
> answered. Where can we put that information suc