【发布时间】:2011-01-21 08:53:55
【问题描述】:
我正在尝试使用str.encode(),但我得到了
>>> "hello".encode(hex)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: must be string, not builtin_function_or_method
我尝试了很多变体,它们似乎都在 Python 2.5.2 中工作,那么我需要做些什么才能让它们在 Python 3.1 中工作?
【问题讨论】:
标签: python string python-3.x hex