import os
path = '/Users/caowei/数据集/Stable/EN-2300-103-RevA.txt'
p_path = os.path.abspath(os.path.join(path, ".."))
print(p_path)
saveDir = os.path.dirname(path)
print(saveDir)
python根据文件路径获取上级目录路径
最新推荐文章于 2022-02-23 23:43:12 发布