python获取当前文件的上一级目录

import os
os.path.dirname(os.path.abspath(__file__))

原文地址:https://www.cnblogs.com/WebLinuxStudy/p/12107772.html