Python 父目录获取

# coding=utf-8
import os

currentPath = os.getcwd() # 当前目录
parent_path = os.path.dirname(currentPath) #将当前目录传入得到当前目录的父目录
print(parent_path)
posted @ 2015-09-06 11:57  3H  阅读(2585)  评论(0编辑  收藏  举报