osdir.com


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Help on PyList 3.7.0


Hey,

Need some help on PyList.


#get path
PyObject *path = PyObject_GetAttrString(sys, "path");

#new user path
PyObject* newPath = PyUnicode_DecodeUTF8(userPath, strlen( userPath ),
errors);

#append  newPath to path
PyList_Append(path, newPath);

How to check if the newPath is already in the path ?

So, If the path contains the newPath, I will not append the newpath.


Thanks for help