python 获取当前文件的绝对路径和父级文件夹路径
current_dir = os.path.abspath(__file__)
parent_folder_path = os.path.dirname(current_dir)
在其他py文件去执行该文件的代码或者获取文件路径就不会出错
python 获取当前文件的绝对路径和父级文件夹路径
current_dir = os.path.abspath(__file__)
parent_folder_path = os.path.dirname(current_dir)
在其他py文件去执行该文件的代码或者获取文件路径就不会出错