import os‘‘‘当前路径  __file__ 与os.path.realpath(__file__) 路径里面的斜杠方向不太一样例如:__file__获取到的路径                   G:/web_pro/ke4/t11.pyos.path.realpath(__file__)获取到的路径 G:\web_pro\ke4\t11.py‘‘‘#获取当前路径 G:\web_pro\ke4\t11.pycurpath = os.path.realpath(__file__)#获取当前路径的上级路径 G:\web_pro\ke4dirpath = os.path.dirname(curpath)#连接路径 G:\web_pro\ke4\common\hello.xlsxtestpath = os.path.join(dirpath,‘common‘,‘hello.xlsx‘)