Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/325.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
Python3.x中PyString作为字符串的替换_Python - Fatal编程技术网

Python3.x中PyString作为字符串的替换

Python3.x中PyString作为字符串的替换,python,Python,在Python2.x版本中,有一个名为PyString\u as\u STRING的函数,用于将pyobject指针转换为字符串或字符指针 我们如何在python 3中实现相同的功能?有一个PyUnicode作为UNICODE宏 顺便说一句:PyString作为字符串仅适用于字符串对象,返回C字符串。另请参见:

在Python2.x版本中,有一个名为PyString\u as\u STRING的函数,用于将pyobject指针转换为字符串或字符指针


我们如何在python 3中实现相同的功能?

有一个PyUnicode作为UNICODE宏

顺便说一句:PyString作为字符串仅适用于字符串对象,返回C字符串。

另请参见: