sebastian wrote:
> Zdravim,
> hledam nejaky modul ktery by umel prevadet mezi bin-dec-hex idealne
> vsechny kombinace vsemi smery ;-) pracoval by pochopitelne s retezci
> ("01010101" apod.).
>
> Zkousel jsem pana Google ale nejak mi nic pouzitelneho nenasel -
> existuje vubec neco takoveho nebo si to budu muset napsat sam (to nechci
> ;-)).
>
> Diky za reakce, Seb.
> _______________________________________________
> Python mailing list
> [email protected]
> http://www.py.cz/mailman/listinfo/python
>
bin -> dec
int('01010101', 2)
hex -> dec
int('55', 16)
int('0x55', 16)
dec -> hex
hex(85)
'0x%x' % 85
dec -> bin
result = ''
number = 85
while number:
result = str(number % 2) + result
number /= 2
print result
Leo
--
----
Leos Pol
SW Engineer
Radiante Corp.
If it can be imagined,
we can implement it
_______________________________________________
Python mailing list
[email protected]
http://www.py.cz/mailman/listinfo/python