# coding=utf-8import oscurrentPath = os.getcwd() # 当前目录parent_path = os.path.dirname(currentPath) #将当前目录传入得到当前目录的父目录print(parent_path)