相关疑难解决方法(0)

Python 3.1.1字符串到十六进制

我正在尝试使用,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中工作?

python string hex python-3.x

63
推荐指数
7
解决办法
11万
查看次数

标签 统计

hex ×1

python ×1

python-3.x ×1

string ×1