Python3中开发目录的引用

Python3中开发目录的引用

import os,sys
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.append(BASE_DIR)
from conf import settings
from core import main

  其中我的软件包中有bin、conf、core几个目录,下面有main.py、settings.py,将其导入至主函数中而已。。。

posted @ 2017-03-07 09:56  KaShing  阅读(822)  评论(0编辑  收藏  举报