1、路径问题
__file__ ##相对路径
os.path.abspath(__file__) #绝对路径
os.path.dirname(os.path.abspath(__file__)) #获取绝对路径的目录名
os.path.basename(os.path.abspath(__file__)) #获取当前路径里面的文件名
os.path.dirname(os.path.dirname(os.path.abspath(__file__))) #获取上一层目录的目录名
1、路径问题
__file__ ##相对路径
os.path.abspath(__file__) #绝对路径
os.path.dirname(os.path.abspath(__file__)) #获取绝对路径的目录名
os.path.basename(os.path.abspath(__file__)) #获取当前路径里面的文件名
os.path.dirname(os.path.dirname(os.path.abspath(__file__))) #获取上一层目录的目录名