> The interesting questions are:
> 1- are you SURE you were using 2.5 yesterday?
> If so:
> 2- did you import some modules? Which ones?
> On my phone I have Python 2.5 too, and it gives the same errors to me.
>
> Is it possible that you upgrade to 2.6 or 2.7 ?
>
hi,
yes i'm sure using Python 2.5 because that's the only version i have. however i
was playing around on how to convert hex to bin, can't remember whether
imported special module.
anyway here is the code that converts hex to bin:
import binascii
def byte_to_binary(n):
return ''.join(str((n & (1 << i)) and 1) for i in reversed(range(8)))
def hex_to_binary(h):
return ''.join(byte_to_binary(ord(b)) for b in binascii.unhexlify(h))
array0 = '000a00000003c0000030000c1f800000'
a=hex_to_binary(array0)
print "a:",a
thanks
tcl
_______________________________________________
Tutor maillist - [email protected]
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor