In [13]:
", ".join(["0x%02x" % ord(c) for c in chr(255)])


Out[13]:
'0xff'

In [16]:
import time

str(int(time.time()))


Out[16]:
'1384866122'

In [17]:
import codecs

codecs.encode("Hello", "hex")


Out[17]:
'48656c6c6f'

In [19]:
chr(3).encode('hex')


Out[19]:
'03'

In [20]:
help(time.time)


Help on built-in function time in module time:

time(...)
    time() -> floating point number
    
    Return the current time in seconds since the Epoch.
    Fractions of a second may be present if the system clock provides them.


In [21]:
1+2


Out[21]:
3

In [ ]: