得到逆序sequence:
x = [1, 2, 3]
r_x = x[::-1]
python 与 C++ 混合:在Visual Studio中编译时必须注意,若Python为64bit而VS C++ Project Config里的platform是32bit,会报错:
Error 1 error LNK2019: unresolved external symbol __imp__Py_Finalize referenced in function _main
Error 2 error LNK2019: unresolved external symbol __imp__PyEval_CallObjectWithKeywords referenced in function _main
Error 3 error LNK2019: unresolved external symbol __imp__PyObject_GetAttrString referenced in function _main
Error 4 error LNK2019: unresolved external symbol __imp__PyImport_ImportModule referenced in function _main
Error 5 error LNK2019: unresolved external symbol __imp__Py_Initialize referenced in function _main
Error 6 error LNK1120: 5 unresolved externals