Worauf die dritte Zeile von unten hinausläuft ist so etwas hier:
Code: Alles auswählen
In [208]: hex(255)
Out[208]: '0xff'
In [209]: hex(255)[2:-1]
Out[209]: 'f'
In [210]: int(hex(255)[2:-1])
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
/home/bj/<ipython console> in <module>()
ValueError: invalid literal for int() with base 10: 'f'