我正在尝试使用,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
Run Code Online (Sandbox Code Playgroud)
我尝试了很多变种,它们似乎都在Python 2.5.2中工作,所以我需要做些什么才能让它们在Python 3.1中工作?