python 获取项目的根路径
转载 https://www.cnblogs.com/angdh/p/10632651.html
root_path = os.path.abspath(os.path.dirname(__file__)).split('shippingSchedule')[0]
(相对的路径(获取文件当前路径)).剪切("匹配字符")[0]
base_dir = os.path.join(sys.path[1], '')
yaml_name = os.path.join(base_dir, 'config','gczx_caps.yaml')
当前路径的相对路径
base_dir = os.path.dirname(os.path.dirname(__file__))