在visualc+中嵌入Python+; 我尝试使用Visual Studio 2019在PythC++中嵌入Python。我在网上找到了一些代码,模仿并执行了程序。我不知道如何解决这个问题:
引发异常读取访问冲突,m为nullptr 我在网上搜索过,没有人回答这个问题 这是python代码:在visualc+中嵌入Python+; 我尝试使用Visual Studio 2019在PythC++中嵌入Python。我在网上找到了一些代码,模仿并执行了程序。我不知道如何解决这个问题:,python,c++,debugging,Python,C++,Debugging,引发异常读取访问冲突,m为nullptr 我在网上搜索过,没有人回答这个问题 这是python代码: '''py_function.py - Python source designed to ''' '''demonstrate the use of python embedding''' def multiply(): c = 12345*6789 print 'The result of 12345 x 6789 :', c return c 您不会在任何地方
'''py_function.py - Python source designed to '''
'''demonstrate the use of python embedding'''
def multiply():
c = 12345*6789
print 'The result of 12345 x 6789 :', c
return c
您不会在任何地方检查
Py(DoSomething)
操作是否成功。其中一个失败了,很可能是进口。我认为你应该使用“py_函数”
而不使用.py
,但这只是一个猜测。另一种可能是无效路径。不管怎样,检查错误。我只是简单地尝试了“py_函数”,但它不起作用。我还尝试键入完整的path.pName=PyUnicode_FromString((char*)“py_函数”);pModule=PyImport\u Import(pName);Py_DECREF(pName);pyDict=PyModule_GetDict(pModule);pFunc=PyDict_GetItemString(PyDict,(char*)“multipy”);这是第一次审判。