python中获得当前目录和上级目录的实现方法 获取当前文件的路径:fromosimportpathd=path.dirname(__file__)#返回当前文件所在的目录#__file__为当 python获得当前目录