小编Ric*_*ard的帖子

如何在 python 中转换字符串以获取 ASCII 数字?

我有这个代码:

str = "text"
x = str.encode('ascii')
print(x)
Run Code Online (Sandbox Code Playgroud)

我得到这个:b'text'

我想得到这个:“116 101 120 116”作为字符串。我想要像我在这里得到的解决方案。

python ascii encode

1
推荐指数
1
解决办法
8731
查看次数

标签 统计

ascii ×1

encode ×1

python ×1