gpt4 book ai didi

python - Python 3.5 中的 Py_InitModule 和 PyString_InternFromString

转载 作者:太空宇宙 更新时间:2023-11-04 05:41:58 25 4
gpt4 key购买 nike

我想将我的 Python 版本从 2.7 更新到 3.5。

编译使用 PyString_InternFromString 和此 Py_InitModule 的代码时

我收到错误信息:

Error   199 error C3861: 'Py_InitModule': identifier not found
Error 196 error C3861: 'PyString_InternFromString': identifier not found

我的问题是,Python 3.5 中的那些标识符有什么等价物?

最佳答案

对于 Py_InitModule,您现在使用的是 PyModule_Create .可以看到example usage in the tutorial example on the Python docs page .

对于实习,Py3的str是基于Py2的unicode类型;在 C 层,您正在使用 PyUnicode 方法,例如PyUnicode_InternFromString .您仍在实习 Python 级别的 str,但实现类型已更改。

关于python - Python 3.5 中的 Py_InitModule 和 PyString_InternFromString,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33641919/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com