supermachine-woodwenli/root_dir.py
2024-05-10 19:08:26 +08:00

13 lines
392 B
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# -*- coding: utf-8 -*-
"""
Created on Nov 3 21:18:26 2020
@author: l.z.y
@e-mail: li.zhenye@qq.com
"""
import pathlib
file_path = pathlib.Path(__file__) # 获得当前文件路径
ROOT_DIR = file_path.parent # 获得当前文件的父目录
# pathlib的作用是将文件路径转换为操作系统的路径格式这样可以避免不同操作系统的路径格式不同的问题