文件路径获取
import sys
print(sys.argv[0])
输出:D:/git/autotest/all_cluster_test/a_biz/excel_process.py
绝对路径转相对路径
import os
print os.path.relpath("D:/git/autotest/all_cluster_test/a_testdata/demo.xlsx")
输出:..\a_testdata\demo.xlsx
相对路径转绝对路径
import os
print os.path.abspath('../a_testdata/demo.xlsx')
输出:D:/git/autotest/all_cluster_test/a_testdata/demo.xlsx