import os

import sys

base_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))  #找到当前项目的项目的路径

print(base_dir)

sys.path.append(base_dir)   #将找到的项目的路径导入当前系统路径

 

相关文章:

  • 2021-05-27
  • 2021-12-14
  • 2021-07-15
  • 2021-12-19
  • 2022-01-06
  • 2021-05-15
  • 2021-12-25
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-12-04
  • 2021-09-18
  • 2021-11-21
  • 2021-08-02
  • 2021-08-07
  • 2021-12-04
相关资源
相似解决方案