import os
current_dir = os.path.abspath(os.path.dirname(__file__)) # 当前文件下的绝对路径
print(current_dir) # 输出:E:\weidian-lc\requestInfo
current_dir1 = os.path.dirname(__file__)
print(current_dir1) #输出:..\requestInfo ,这个和上面那个绝对路径都可用
print(os.getcwd()) # 获得当前工作目录
print(os.path.abspath('.')) # 获得当前工作目录
print(os.path.abspath('..')) # 获得当前工作目录的父目录
print(os.path.abspath(os.curdir)) # 获得当前工作目录