所以这里的问题是......
假设提供了Sharepoint存储库和文件夹,我将如何检查每个文件夹是否存在并创建不存在的文件夹和子文件夹。
例如:对于文件夹路径def unit_vector(vector):
print(vector)
""" Returns the unit vector of the vector. """
return vector / np.linalg.norm(vector)
def angle_between(v1, v2):
""" Returns the angle in radians between vectors 'v1' and 'v2'::
>>> angle_between((1, 0, 0), (0, 1, 0))
1.5707963267948966
>>> angle_between((1, 0, 0), (1, 0, 0))
0.0
>>> angle_between((1, 0, 0), (-1, 0, 0))
3.141592653589793
"""
v1_u = unit_vector(v1)
v2_u = unit_vector(v2)
return np.arccos(np.clip(np.dot(v1_u, v2_u), -1.0, 1.0))
v1, v2, v3 = triangle[0], triangle[1], triangle[2]
vec1, vec2, vec3 = v2-v1, v3-v2, v3-v1
a1, a2, a3 = angle_between(vec1,vec2),angle_between(vec2,vec3),angle_between(vec3,vec1)
print(a1,a2,a3)
2.09440780623 1.04722295888 1.04718484736
,如果存在/documents/pdfs/bills/january/house/
,但子文件夹documents
不存在,我将如何继续创建文档文件夹下的所有文件夹?
我必须使用Apache Chemistry CMIS Library来完成这项工作。