Don't know if this is what you mean, but: Binary to decimal: >>> bin_num = '100001011' >>> int(bin_num, 2) 267 >>> def dec2bin(dec_number): ... if dec_number == 0: return '0' ... return (dec2bin(dec_number >> 1) + str(dec_number % 2)) ... >>> dec2bin(267) '0100001011' -- Guyon Morée guyon.moreeNOSP at Mgmail.com http://gumuz.looze.net