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

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

import os


def getRootPath():
    rootPath = os.path.dirname(os.path.abspath(__file__))
    return rootPath

 

posted @ 2018-06-05 19:38  zipon  阅读(3781)  评论(0编辑  收藏  举报