Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/328.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/jquery-ui/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python二进制字符串转换为ASCII文本_Python_Python 3.x_Binary_Ascii - Fatal编程技术网

Python二进制字符串转换为ASCII文本

Python二进制字符串转换为ASCII文本,python,python-3.x,binary,ascii,Python,Python 3.x,Binary,Ascii,如何将此字符串转换为ASCII码 预期结果: x = "01100001" 使用下面的一个班轮 print(x.somefunction()) Output: a 会有用的。你在谷歌上搜索过吗?在我的谷歌搜索上已经有了一个非常好的答案: x = chr(int('010101010',2))

如何将此字符串转换为ASCII码

预期结果:

x = "01100001"

使用下面的一个班轮

print(x.somefunction())
Output: a

会有用的。

你在谷歌上搜索过吗?在我的谷歌搜索上已经有了一个非常好的答案:
x = chr(int('010101010',2))