获取当前目录 import os The_Catalog=os.getcwd() 获取当前目录父目录 Father_Catalog=os.path.abspath(os.path.dirname(The_Catalog)+os.path.sep+".")