unsigned long to unsigned char

ashtonn@gmail.com doodle4 at gmail.com
Wed Jun 1 13:43:10 EDT 2005


Hello,

Is it possible to convert unsigned long( 4 bytes) to unsigned char(1
byte), so that i could define a common array for both.

import array
temp = array('B', '\0' * 512)

for i in range( 2):
    temp[0] = 0xFF
    temp[1] = 0xFFFFFFFF

Thanks,
-Ashton




More information about the Python-list mailing list