如题:
究其主要原因是py标准库的各个模块路径未找到。
通过void PySys_SetPath(char *path)注意参数说明,为分号隔开的路径列表;
void FindFile(const CString &strPath,CString &strList)
{
if(strList.IsEmpty())
strList = strPath;
else
strList = strList + _T(";") + strPath;
CFileFind ff;
CString str = strPath + _T("\\*.*");
BOOL bFind = ff.FindFile(str);
while(bFind)
{
bFind = ff.FindNextFile();
if(ff.IsDirectory()&& !ff.IsDots())
{
CString str = ff.GetFilePath();
// PySys_SetPath(CT2A(str).m_psz);
//
TRACE(str);
TRACE(_T("\n"));
FindFile(str,strList);
}
}
}
CString strList = _T("F:\\");
CString strPath = _T("F:\\python\\Python26\\Lib");
FindFile(strPath,strList);
PySys_SetPath(CT2A(strList).m_psz);