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,将其导入至主函数中而已。。。
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,将其导入至主函数中而已。。。
转载于:https://www.cnblogs.com/hjc4025/p/6513181.html