def GetParentPath(strPath):
if not strPath:
return None;
lsPath = os.path.split(strPath);
print(lsPath);
print("lsPath[1] = %s" %lsPath[1]);
if lsPath[1]:
return lsPath[0];
lsPath = os.path.split(lsPath[0]);
return lsPath[0];
strPath = GetCurrPath();
print("curr path: %s" %strPath);
#print(GetParentPath(strPath));
strPath += "/";
print(GetParentPath(strPath));
print(GetParentPath("/"));
分享到:
2010-12-09 14:03
浏览 10247
评论