【python接口自动化】获取根目录

将该方法放在根目录下面,在其他类中直接import 该方法。

import os


def getRootPath():
    rootPath = os.path.dirname(os.path.abspath(__file__))
    return rootPath
原文地址:https://www.cnblogs.com/zipon/p/9141487.html