Python 3.1.1 string to hex

Posted by Stuart on Stack Overflow See other posts from Stack Overflow or by Stuart
Published on 2010-02-26T08:27:09Z Indexed on 2010/04/12 9:53 UTC
Read the original article Hit count: 425

Filed under:
|
|
|
|

I am trying to use str.encode() but I get

>>> "hello".encode(hex)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: must be string, not builtin_function_or_method

I have tried a bunch of variations and they seem to all work in Python 2.5.2, so what do I need to do to get them to work in Python 3.1?

© Stack Overflow or respective owner

Related posts about python

Related posts about hex